mirror of https://github.com/zulip/zulip.git
custom_profile_fields: Clarify an external account error message.
This error message is for a very precise situation -- the pattern not having the desired format. We should say that, rather than a generic "Malformed".
This commit is contained in:
parent
6a5d646739
commit
08e8a21da0
|
@ -365,7 +365,7 @@ def check_external_account_url_pattern(var_name: str, val: object) -> str:
|
||||||
s = check_string(var_name, val)
|
s = check_string(var_name, val)
|
||||||
|
|
||||||
if s.count("%(username)s") != 1:
|
if s.count("%(username)s") != 1:
|
||||||
raise ValidationError(_("Malformed URL pattern."))
|
raise ValidationError(_("URL pattern must contain '%(username)s'."))
|
||||||
url_val = s.replace("%(username)s", "username")
|
url_val = s.replace("%(username)s", "username")
|
||||||
|
|
||||||
check_url(var_name, url_val)
|
check_url(var_name, url_val)
|
||||||
|
|
|
@ -290,7 +290,7 @@ class CreateCustomProfileFieldTest(CustomProfileFieldTestCase):
|
||||||
}
|
}
|
||||||
).decode()
|
).decode()
|
||||||
result = self.client_post("/json/realm/profile_fields", info=data)
|
result = self.client_post("/json/realm/profile_fields", info=data)
|
||||||
self.assert_json_error(result, "Malformed URL pattern.")
|
self.assert_json_error(result, "URL pattern must contain '%(username)s'.")
|
||||||
|
|
||||||
data["field_data"] = orjson.dumps(
|
data["field_data"] = orjson.dumps(
|
||||||
{
|
{
|
||||||
|
@ -299,7 +299,7 @@ class CreateCustomProfileFieldTest(CustomProfileFieldTestCase):
|
||||||
}
|
}
|
||||||
).decode()
|
).decode()
|
||||||
result = self.client_post("/json/realm/profile_fields", info=data)
|
result = self.client_post("/json/realm/profile_fields", info=data)
|
||||||
self.assert_json_error(result, "Malformed URL pattern.")
|
self.assert_json_error(result, "URL pattern must contain '%(username)s'.")
|
||||||
|
|
||||||
data["field_data"] = orjson.dumps(
|
data["field_data"] = orjson.dumps(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue