mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
users: Modify do_create_user and create_user to accept role.
We change do_create_user and create_user to accept role as a parameter instead of 'is_realm_admin' and 'is_guest'. These changes are done to minimize data conversions between role and boolean fields.
This commit is contained in:
@@ -59,7 +59,7 @@ class Command(BaseCommand):
|
||||
with mock.patch("zerver.lib.create_user.timezone_now", return_value=installation_time):
|
||||
shylock = create_user('shylock@analytics.ds', 'Shylock', realm,
|
||||
full_name='Shylock', short_name='shylock',
|
||||
is_realm_admin=True)
|
||||
role=UserProfile.ROLE_REALM_ADMINISTRATOR)
|
||||
do_change_user_role(shylock, UserProfile.ROLE_REALM_ADMINISTRATOR)
|
||||
stream = Stream.objects.create(
|
||||
name='all', realm=realm, date_created=installation_time)
|
||||
|
||||
@@ -67,7 +67,7 @@ class AnalyticsTestCase(TestCase):
|
||||
return create_user(kwargs['email'], 'password', kwargs['realm'],
|
||||
active=kwargs['is_active'],
|
||||
full_name=kwargs['full_name'], short_name=kwargs['short_name'],
|
||||
is_realm_admin=True, **pass_kwargs)
|
||||
role=UserProfile.ROLE_REALM_ADMINISTRATOR, **pass_kwargs)
|
||||
|
||||
def create_stream_with_recipient(self, **kwargs: Any) -> Tuple[Stream, Recipient]:
|
||||
self.name_counter += 1
|
||||
|
||||
Reference in New Issue
Block a user