models: Add USER_SOFT_ACTIVATED event type constant to RealmAuditLog.

This commit is contained in:
Vishnu Ks 2018-07-10 15:10:49 +05:30 committed by Tim Abbott
parent a0da184d50
commit 547b5675c6
3 changed files with 3 additions and 2 deletions

View File

@ -197,7 +197,7 @@ def maybe_catch_up_soft_deactivated_user(user_profile: UserProfile) -> Union[Use
RealmAuditLog.objects.create(
realm=user_profile.realm,
modified_user=user_profile,
event_type='user_soft_activated',
event_type=RealmAuditLog.USER_SOFT_ACTIVATED,
event_time=timezone_now()
)
logger.info('Soft Reactivated user %s (%s)' %

View File

@ -1965,6 +1965,7 @@ class RealmAuditLog(models.Model):
USER_ACTIVATED = 'user_activated'
USER_DEACTIVATED = 'user_deactivated'
USER_REACTIVATED = 'user_reactivated'
USER_SOFT_ACTIVATED = 'user_soft_activated'
USER_CHANGE_PASSWORD = 'user_change_password'
USER_CHANGE_AVATAR_SOURCE = 'user_change_avatar_source'
USER_FULL_NAME_CHANGED = 'user_full_name_changed'

View File

@ -2913,7 +2913,7 @@ class SoftDeactivationMessageTest(ZulipTestCase):
self.assert_length(queries, 7)
self.assertFalse(long_term_idle_user.long_term_idle)
self.assertEqual(last_realm_audit_log_entry(
'user_soft_activated').modified_user, long_term_idle_user)
RealmAuditLog.USER_SOFT_ACTIVATED).modified_user, long_term_idle_user)
idle_user_msg_list = get_user_messages(long_term_idle_user)
self.assertEqual(len(idle_user_msg_list), idle_user_msg_count + 1)
self.assertEqual(idle_user_msg_list[-1].content, message)