mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-07 23:10:41 -04:00
Merge pull request #3853 from alphagov/unknown-event-doer
Don't show user as unknown for service history
This commit is contained in:
@@ -652,6 +652,12 @@ class Users(ModelList):
|
||||
for user in self:
|
||||
if user.id == id:
|
||||
return user.name
|
||||
# The user may not exist in the list of users for this service if they are
|
||||
# a platform admin or if they have since left the team. In this case, we fall
|
||||
# back to getting the user from the API (or Redis if it is in the cache)
|
||||
user = User.from_id(id)
|
||||
if user and user.name:
|
||||
return user.name
|
||||
return 'Unknown'
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ from tests.conftest import SERVICE_ONE_ID, normalize_spaces
|
||||
'Created an API key called ‘Good key’ '
|
||||
'Test User 10:09am '
|
||||
'Created an API key called ‘Key event returned in non-chronological order’ '
|
||||
'Unknown 2:01am '
|
||||
'Test User 2:01am '
|
||||
'Created this service and called it ‘Example service’'
|
||||
),
|
||||
),
|
||||
@@ -79,7 +79,7 @@ from tests.conftest import SERVICE_ONE_ID, normalize_spaces
|
||||
(
|
||||
'10 October 2010',
|
||||
(
|
||||
'Unknown 2:01am '
|
||||
'Test User 2:01am '
|
||||
'Created this service and called it ‘Example service’'
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user