python: Convert percent formatting to Python 3.6 f-strings.

Generated by pyupgrade --py36-plus.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-09 21:41:04 -07:00
committed by Tim Abbott
parent 6480deaf27
commit 67e7a3631d
217 changed files with 776 additions and 846 deletions

View File

@@ -28,7 +28,7 @@ def check_config() -> None:
except AttributeError:
pass
raise CommandError("Error: You must set %s in /etc/zulip/settings.py." % (setting_name,))
raise CommandError(f"Error: You must set {setting_name} in /etc/zulip/settings.py.")
def sleep_forever() -> None:
while True: # nocoverage
@@ -127,7 +127,7 @@ You can use the command list_realms to find ID of the realms in this server."""
return UserProfile.objects.select_related().get(
delivery_email__iexact=email.strip(), realm=realm)
except UserProfile.DoesNotExist:
raise CommandError("The realm '%s' does not contain a user with email '%s'" % (realm, email))
raise CommandError(f"The realm '{realm}' does not contain a user with email '{email}'")
# Realm is None in the remaining code path. Here, we
# optimistically try to see if there is exactly one user with
@@ -139,7 +139,7 @@ You can use the command list_realms to find ID of the realms in this server."""
"(in different realms); please pass `--realm` "
"to specify which one to modify.")
except UserProfile.DoesNotExist:
raise CommandError("This Zulip server does not contain a user with email '%s'" % (email,))
raise CommandError(f"This Zulip server does not contain a user with email '{email}'")
def get_client(self) -> Client:
"""Returns a Zulip Client object to be used for things done in management commands"""