snapshot: preserve current tubco portal baseline
This commit is contained in:
@@ -363,6 +363,15 @@ def _user_management_rows():
|
||||
|
||||
|
||||
def _render_user_management(request, create_form=None, status_code: int = 200):
|
||||
recent_user_events = list(
|
||||
AdminAuditLog.objects.select_related('actor')
|
||||
.filter(action__in=['user_created', 'user_updated', 'user_password_reset_sent', 'user_deleted'])
|
||||
.order_by('-created_at', '-id')[:12]
|
||||
)
|
||||
for row in recent_user_events:
|
||||
row.action_label = _audit_action_label(row.action)
|
||||
role_key = (row.details or {}).get('role')
|
||||
row.role_label = str(ROLE_LABELS[role_key]) if role_key in ROLE_LABELS else role_key
|
||||
return render(
|
||||
request,
|
||||
'workflows/user_management.html',
|
||||
@@ -370,6 +379,7 @@ def _render_user_management(request, create_form=None, status_code: int = 200):
|
||||
'create_form': create_form or UserManagementCreateForm(),
|
||||
'rows': _user_management_rows(),
|
||||
'role_choices': [(key, str(ROLE_LABELS[key])) for key in ROLE_GROUP_NAMES],
|
||||
'recent_user_events': recent_user_events,
|
||||
},
|
||||
status=status_code,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user