mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
python: Normalize quotes with Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
11741543da
commit
6e4c3e41dc
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user