Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

subscriptions: Fix stale parameter name in invalid color error.

Agnish Bauri1374f7915d0a
diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py
index bc0627abd6d..e2727bafe21 100644
--- a/zerver/tests/test_subs.py
+++ b/zerver/tests/test_subs.py
@@ -3518,7 +3518,7 @@ class SubscriptionRestApiTest(ZulipTestCase):
subscriptions = [{"name": "my_test_stream_3", "color": "#0g0g0g"}]
result = self.subscribe_via_post(user, subscriptions, allow_fail=True)
self.assert_json_error(
- result, "Invalid subscriptions[0]: Value error, add.color is not a valid hex color code"
+ result, "Invalid subscriptions[0]: Value error, color is not a valid hex color code"
)
def test_api_valid_property(self) -> None:
diff --git a/zerver/views/streams.py b/zerver/views/streams.py
index 5a39823d0a2..a9bc126d90b 100644
--- a/zerver/views/streams.py
+++ b/zerver/views/streams.py
@@ -568,7 +568,7 @@ class AddSubscriptionData(BaseModel):
@model_validator(mode="after")
def validate_terms(self) -> "AddSubscriptionData":
if self.color is not None:
- self.color = check_color("add.color", self.color)
+ self.color = check_color("color", self.color)
return self