python: Normalize quotes with Black.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:20:45 -08:00
committed by Tim Abbott
parent 11741543da
commit 6e4c3e41dc
989 changed files with 32792 additions and 32792 deletions

View File

@@ -14,14 +14,14 @@ from zerver.models import PushDeviceToken, UserProfile
def validate_token(token_str: str, kind: int) -> None:
if token_str == '' or len(token_str) > 4096:
raise JsonableError(_('Empty or invalid length token'))
if token_str == "" or len(token_str) > 4096:
raise JsonableError(_("Empty or invalid length token"))
if kind == PushDeviceToken.APNS:
# Validate that we can actually decode the token.
try:
b64_to_hex(token_str)
except Exception:
raise JsonableError(_('Invalid APNS token'))
raise JsonableError(_("Invalid APNS token"))
@human_users_only