diff --git a/zilencer/management/commands/add_mock_conversation.py b/zilencer/management/commands/add_mock_conversation.py index cf03e0ac10..94a20a7b7d 100644 --- a/zilencer/management/commands/add_mock_conversation.py +++ b/zilencer/management/commands/add_mock_conversation.py @@ -69,7 +69,8 @@ From image editing program: 'content': "I'm also a big fan of inline link, tweet, video, and image previews. " "Check out this picture of Çet Whalin[](/static/images/features/whale.png)!"}, {'sender': starr, - 'content': "I just set up a custom linkifier, so `#1234` becomes [#1234](github.com/zulip/zulip/1234), " + 'content': "I just set up a custom linkifier, " + "so `#1234` becomes [#1234](github.com/zulip/zulip/1234), " "a link to the corresponding GitHub issue."}, {'sender': twitter_bot, 'content': 'https://twitter.com/gvanrossum/status/786661035637772288'}, diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index 1ec0760b30..5b2eb22c57 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -124,7 +124,8 @@ class Command(BaseCommand): # welcome-bot (needed for do_create_realm) hasn't been created yet zulip_realm = Realm.objects.create( string_id="zulip", name="Zulip Dev", restricted_to_domain=True, - description="The Zulip development environment default organization. It's great for testing!", + description="The Zulip development environment default organization." + " It's great for testing!", invite_required=False, org_type=Realm.CORPORATE) RealmDomain.objects.create(realm=zulip_realm, domain="zulip.com") if options["test_suite"]: @@ -261,7 +262,10 @@ class Command(BaseCommand): client = get_client("website") if user.full_name[0] <= 'H': client = get_client("ZulipAndroid") - UserPresence.objects.get_or_create(user_profile=user, client=client, timestamp=date, status=status) + UserPresence.objects.get_or_create(user_profile=user, + client=client, + timestamp=date, + status=status) user_profiles_ids = [user_profile.id for user_profile in user_profiles] diff --git a/zilencer/management/commands/profile_request.py b/zilencer/management/commands/profile_request.py index ee51631f4d..04acc04f97 100644 --- a/zilencer/management/commands/profile_request.py +++ b/zilencer/management/commands/profile_request.py @@ -23,8 +23,9 @@ class MockRequest(HttpRequest): self.path = '/' self.method = "POST" self.META = {"REMOTE_ADDR": "127.0.0.1"} + anchor = UserMessage.objects.filter(user_profile=self.user).order_by("-message")[200].message_id self.REQUEST = { - "anchor": UserMessage.objects.filter(user_profile=self.user).order_by("-message")[200].message_id, + "anchor": anchor, "num_before": 1200, "num_after": 200 }