populate_db: Change role of 'desdemona' to realm owner.

Modified by tabbott to update PROVISION_VERSION.
This commit is contained in:
sahil839 2020-06-01 21:07:35 +05:30 committed by Tim Abbott
parent 169bd3082a
commit 2fe8971204
3 changed files with 4 additions and 5 deletions

View File

@ -44,4 +44,4 @@ API_FEATURE_LEVEL = 7
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = '82.3'
PROVISION_VERSION = '83.0'

View File

@ -3899,10 +3899,9 @@ class DeactivateUserTest(ZulipTestCase):
def test_do_not_deactivate_final_user(self) -> None:
realm = get_realm('zulip')
do_change_user_role(self.example_user("desdemona"), UserProfile.ROLE_MEMBER)
UserProfile.objects.filter(realm=realm).exclude(
role=UserProfile.ROLE_REALM_ADMINISTRATOR).update(is_active=False)
user = self.example_user("iago")
role=UserProfile.ROLE_REALM_OWNER).update(is_active=False)
user = self.example_user("desdemona")
self.login_user(user)
result = self.client_delete('/json/users/me')
self.assert_json_error(result, "Cannot deactivate the only user.")

View File

@ -283,7 +283,7 @@ class Command(BaseCommand):
iago.save(update_fields=['is_staff'])
desdemona = get_user_by_delivery_email("desdemona@zulip.com", zulip_realm)
do_change_user_role(desdemona, UserProfile.ROLE_REALM_ADMINISTRATOR)
do_change_user_role(desdemona, UserProfile.ROLE_REALM_OWNER)
guest_user = get_user_by_delivery_email("polonius@zulip.com", zulip_realm)
guest_user.role = UserProfile.ROLE_GUEST