audit_log: Log acting_user in user creation and user activation.

This commit is contained in:
arpit551
2020-06-29 16:42:17 +05:30
committed by Tim Abbott
parent 653928bdfe
commit 01f12b9fc2
10 changed files with 28 additions and 22 deletions

View File

@@ -45,12 +45,12 @@ From image editing program:
stream = ensure_stream(realm, 'zulip features')
UserProfile.objects.filter(email__contains='stage').delete()
starr = do_create_user('1@stage.example.com', 'password', realm, 'Ada Starr', '')
starr = do_create_user('1@stage.example.com', 'password', realm, 'Ada Starr', '', acting_user=None)
self.set_avatar(starr, 'static/images/characters/starr.png')
fisher = do_create_user('2@stage.example.com', 'password', realm, 'Bel Fisher', '')
fisher = do_create_user('2@stage.example.com', 'password', realm, 'Bel Fisher', '', acting_user=None)
self.set_avatar(fisher, 'static/images/characters/fisher.png')
twitter_bot = do_create_user('3@stage.example.com', 'password', realm, 'Twitter Bot', '',
bot_type=UserProfile.DEFAULT_BOT)
bot_type=UserProfile.DEFAULT_BOT, acting_user=None)
self.set_avatar(twitter_bot, 'static/images/features/twitter.png')
bulk_add_subscriptions([stream], list(UserProfile.objects.filter(realm=realm)))

View File

@@ -17,7 +17,7 @@ class Command(ZulipBaseCommand):
name = '{:02}-user'.format(
UserProfile.objects.filter(email__contains='user@').count())
user = do_create_user(f'{name}@{string_id}.zulip.com',
'password', realm, name, name, role=UserProfile.ROLE_REALM_ADMINISTRATOR)
'password', realm, name, name, role=UserProfile.ROLE_REALM_ADMINISTRATOR, acting_user=None)
assert realm.signup_notifications_stream is not None
bulk_add_subscriptions([realm.signup_notifications_stream], [user])

View File

@@ -30,4 +30,4 @@ and will otherwise fall back to the zulip realm."""
domain = realm.string_id + '.zulip.com'
name = '{:02}-user'.format(UserProfile.objects.filter(email__contains='user@').count())
do_create_user(f'{name}@{domain}', 'password', valid_realm, name, name)
do_create_user(f'{name}@{domain}', 'password', valid_realm, name, name, acting_user=None)