mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
stream settings: Add period at the end of error messages.
This commit is contained in:
@@ -484,14 +484,14 @@ $(function () {
|
|||||||
stream_events.mark_subscribed(sub);
|
stream_events.mark_subscribed(sub);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stream_subscription_info_elem.text(i18n.t("User already subscribed"));
|
stream_subscription_info_elem.text(i18n.t("User already subscribed."));
|
||||||
}
|
}
|
||||||
stream_subscription_info_elem.addClass("text-success")
|
stream_subscription_info_elem.addClass("text-success")
|
||||||
.removeClass("text-error");
|
.removeClass("text-error");
|
||||||
}
|
}
|
||||||
|
|
||||||
function invite_failure() {
|
function invite_failure() {
|
||||||
stream_subscription_info_elem.text(i18n.t("Could not add user to this stream"))
|
stream_subscription_info_elem.text(i18n.t("Could not add user to this stream."))
|
||||||
.addClass("text-error")
|
.addClass("text-error")
|
||||||
.removeClass("text-success");
|
.removeClass("text-success");
|
||||||
}
|
}
|
||||||
@@ -528,14 +528,14 @@ $(function () {
|
|||||||
stream_events.mark_unsubscribed(sub);
|
stream_events.mark_unsubscribed(sub);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stream_subscription_info_elem.text(i18n.t("User is already not subscribed"));
|
stream_subscription_info_elem.text(i18n.t("User is already not subscribed."));
|
||||||
}
|
}
|
||||||
stream_subscription_info_elem.addClass('text-success')
|
stream_subscription_info_elem.addClass('text-success')
|
||||||
.removeClass('text-error');
|
.removeClass('text-error');
|
||||||
}
|
}
|
||||||
|
|
||||||
function removal_failure() {
|
function removal_failure() {
|
||||||
stream_subscription_info_elem.text(i18n.t("Error removing user from this stream"))
|
stream_subscription_info_elem.text(i18n.t("Error removing user from this stream."))
|
||||||
.addClass("text-error")
|
.addClass("text-error")
|
||||||
.removeClass("text-success");
|
.removeClass("text-success");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1715,7 +1715,7 @@ def check_stream_name(stream_name: Text) -> None:
|
|||||||
if stream_name.strip() == "":
|
if stream_name.strip() == "":
|
||||||
raise JsonableError(_("Invalid stream name '%s'" % (stream_name)))
|
raise JsonableError(_("Invalid stream name '%s'" % (stream_name)))
|
||||||
if len(stream_name) > Stream.MAX_NAME_LENGTH:
|
if len(stream_name) > Stream.MAX_NAME_LENGTH:
|
||||||
raise JsonableError(_("Stream name too long (limit: %s characters)" % (Stream.MAX_NAME_LENGTH)))
|
raise JsonableError(_("Stream name too long (limit: %s characters)." % (Stream.MAX_NAME_LENGTH)))
|
||||||
if set(stream_name).intersection(Stream.NAME_INVALID_CHARS):
|
if set(stream_name).intersection(Stream.NAME_INVALID_CHARS):
|
||||||
raise JsonableError(_("Invalid characters in stream name (disallowed characters: %s)."
|
raise JsonableError(_("Invalid characters in stream name (disallowed characters: %s)."
|
||||||
% ((', ').join(Stream.NAME_INVALID_CHARS))))
|
% ((', ').join(Stream.NAME_INVALID_CHARS))))
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ def check_stream_name_available(realm: Realm, name: Text) -> None:
|
|||||||
check_stream_name(name)
|
check_stream_name(name)
|
||||||
try:
|
try:
|
||||||
get_stream(name, realm)
|
get_stream(name, realm)
|
||||||
raise JsonableError(_("Stream name '%s' is already taken") % (name,))
|
raise JsonableError(_("Stream name '%s' is already taken.") % (name,))
|
||||||
except Stream.DoesNotExist:
|
except Stream.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -308,10 +308,10 @@ class StreamAdminTest(ZulipTestCase):
|
|||||||
self.assert_json_error(result, "Stream already has that name!")
|
self.assert_json_error(result, "Stream already has that name!")
|
||||||
result = self.client_patch('/json/streams/%d' % (stream.id,),
|
result = self.client_patch('/json/streams/%d' % (stream.id,),
|
||||||
{'new_name': ujson.dumps('Denmark')})
|
{'new_name': ujson.dumps('Denmark')})
|
||||||
self.assert_json_error(result, "Stream name 'Denmark' is already taken")
|
self.assert_json_error(result, "Stream name 'Denmark' is already taken.")
|
||||||
result = self.client_patch('/json/streams/%d' % (stream.id,),
|
result = self.client_patch('/json/streams/%d' % (stream.id,),
|
||||||
{'new_name': ujson.dumps('denmark ')})
|
{'new_name': ujson.dumps('denmark ')})
|
||||||
self.assert_json_error(result, "Stream name 'denmark' is already taken")
|
self.assert_json_error(result, "Stream name 'denmark' is already taken.")
|
||||||
|
|
||||||
# Do a rename that is case-only--this should succeed.
|
# Do a rename that is case-only--this should succeed.
|
||||||
result = self.client_patch('/json/streams/%d' % (stream.id,),
|
result = self.client_patch('/json/streams/%d' % (stream.id,),
|
||||||
@@ -1338,7 +1338,7 @@ class SubscriptionRestApiTest(ZulipTestCase):
|
|||||||
}
|
}
|
||||||
result = self.api_patch(email, "/api/v1/users/me/subscriptions", request)
|
result = self.api_patch(email, "/api/v1/users/me/subscriptions", request)
|
||||||
self.assert_json_error(result,
|
self.assert_json_error(result,
|
||||||
"Stream name too long (limit: 60 characters)")
|
"Stream name too long (limit: 60 characters).")
|
||||||
|
|
||||||
def test_stream_name_has_invalid_characters(self) -> None:
|
def test_stream_name_has_invalid_characters(self) -> None:
|
||||||
email = self.example_email('hamlet')
|
email = self.example_email('hamlet')
|
||||||
@@ -1651,7 +1651,7 @@ class SubscriptionAPITest(ZulipTestCase):
|
|||||||
long_stream_name = "a" * 61
|
long_stream_name = "a" * 61
|
||||||
result = self.common_subscribe_to_streams(self.test_email, [long_stream_name])
|
result = self.common_subscribe_to_streams(self.test_email, [long_stream_name])
|
||||||
self.assert_json_error(result,
|
self.assert_json_error(result,
|
||||||
"Stream name too long (limit: 60 characters)")
|
"Stream name too long (limit: 60 characters).")
|
||||||
|
|
||||||
def test_subscriptions_add_stream_with_null(self) -> None:
|
def test_subscriptions_add_stream_with_null(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user