mirror of https://github.com/zulip/zulip.git
push registration: Use standard error message for auth problems.
This avoids adding an unnecessary new translated string.
This commit is contained in:
parent
9d6233a457
commit
7cbff8b521
|
@ -1396,4 +1396,5 @@ class PushBouncerSignupTest(ZulipTestCase):
|
||||||
contact_email="server-admin@example.com",
|
contact_email="server-admin@example.com",
|
||||||
)
|
)
|
||||||
result = self.client_post("/api/v1/remotes/server/register", request)
|
result = self.client_post("/api/v1/remotes/server/register", request)
|
||||||
self.assert_json_error(result, "zulip_org_id and zulip_org_key do not match.")
|
self.assert_json_error(result, "Zulip server auth failure: key does not match role %s" %
|
||||||
|
(zulip_org_id,))
|
||||||
|
|
|
@ -12,7 +12,7 @@ from django.conf import settings
|
||||||
from django.views.decorators.http import require_GET
|
from django.views.decorators.http import require_GET
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
|
||||||
from zerver.decorator import require_post, zulip_login_required
|
from zerver.decorator import require_post, zulip_login_required, InvalidZulipServerKeyError
|
||||||
from zerver.lib.exceptions import JsonableError
|
from zerver.lib.exceptions import JsonableError
|
||||||
from zerver.lib.push_notifications import send_android_push_notification, \
|
from zerver.lib.push_notifications import send_android_push_notification, \
|
||||||
send_apple_push_notification
|
send_apple_push_notification
|
||||||
|
@ -70,7 +70,7 @@ def register_remote_server(
|
||||||
|
|
||||||
if not created:
|
if not created:
|
||||||
if remote_server.api_key != zulip_org_key:
|
if remote_server.api_key != zulip_org_key:
|
||||||
raise JsonableError(err_("zulip_org_id and zulip_org_key do not match."))
|
raise InvalidZulipServerKeyError(zulip_org_id)
|
||||||
else:
|
else:
|
||||||
remote_server.hostname = hostname
|
remote_server.hostname = hostname
|
||||||
remote_server.contact_email = contact_email
|
remote_server.contact_email = contact_email
|
||||||
|
|
Loading…
Reference in New Issue