mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Add an event if a user is archived
This adds a new type of event, 'archive_user', which stores the id of the archived user and the id of the user who is doing the archiving.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from flask import flash, redirect, render_template, request, url_for
|
||||
from flask_login import login_required
|
||||
from flask_login import current_user, login_required
|
||||
|
||||
from app import user_api_client
|
||||
from app.event_handlers import create_archive_user_event
|
||||
from app.main import main
|
||||
from app.main.forms import SearchUsersByEmailForm
|
||||
from app.models.user import User
|
||||
@@ -45,6 +46,8 @@ def user_information(user_id):
|
||||
def archive_user(user_id):
|
||||
if request.method == 'POST':
|
||||
user_api_client.archive_user(user_id)
|
||||
create_archive_user_event(str(user_id), current_user.id)
|
||||
|
||||
return redirect(url_for('.user_information', user_id=user_id))
|
||||
else:
|
||||
flash('There\'s no way to reverse this! Are you sure you want to archive this user?', 'delete')
|
||||
|
||||
Reference in New Issue
Block a user