From 271cfd4d7ab5d77fcd81be2210dde84b2789cae9 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 15 Feb 2018 11:50:37 -0800 Subject: [PATCH] translation: Try the new `err_` marking on a handful of messages. --- zilencer/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zilencer/views.py b/zilencer/views.py index 624e3eb6ba..37491e5ea0 100644 --- a/zilencer/views.py +++ b/zilencer/views.py @@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Text, Union, cast from django.http import HttpRequest, HttpResponse from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext as _, ugettext as err_ from django.shortcuts import render from django.conf import settings from django.views.decorators.http import require_GET @@ -24,12 +24,12 @@ from zilencer.models import RemotePushDeviceToken, RemoteZulipServer def validate_entity(entity: Union[UserProfile, RemoteZulipServer]) -> None: if not isinstance(entity, RemoteZulipServer): - raise JsonableError(_("Must validate with valid Zulip server API key")) + raise JsonableError(err_("Must validate with valid Zulip server API key")) def validate_bouncer_token_request(entity: Union[UserProfile, RemoteZulipServer], token: bytes, kind: int) -> None: if kind not in [RemotePushDeviceToken.APNS, RemotePushDeviceToken.GCM]: - raise JsonableError(_("Invalid token type")) + raise JsonableError(err_("Invalid token type")) validate_entity(entity) validate_token(token, kind) @@ -70,7 +70,7 @@ def remote_server_unregister_push(request: HttpRequest, entity: Union[UserProfil kind=token_kind, server=server).delete() if deleted[0] == 0: - return json_error(_("Token does not exist")) + return json_error(err_("Token does not exist")) return json_success()