Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
settings: Validate desktop_icon_display_count value in 'PATCH /settings'.
Sahil Batrade4c0d9fe9fd
diff --git a/zerver/models.py b/zerver/models.pyindex d5d1e630df8..4d312df5f30 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -1349,6 +1349,11 @@ class UserBaseSettings(models.Model):DESKTOP_ICON_COUNT_DISPLAY_MESSAGES = 1DESKTOP_ICON_COUNT_DISPLAY_NOTIFIABLE = 2DESKTOP_ICON_COUNT_DISPLAY_NONE = 3+ DESKTOP_ICON_COUNT_DISPLAY_CHOICES = [+ DESKTOP_ICON_COUNT_DISPLAY_MESSAGES,+ DESKTOP_ICON_COUNT_DISPLAY_NOTIFIABLE,+ DESKTOP_ICON_COUNT_DISPLAY_NONE,+ ]desktop_icon_count_display: int = models.PositiveSmallIntegerField(default=DESKTOP_ICON_COUNT_DISPLAY_MESSAGES)diff --git a/zerver/views/user_settings.py b/zerver/views/user_settings.pyindex 4f0be1363de..a494224f4ee 100644--- a/zerver/views/user_settings.py+++ b/zerver/views/user_settings.py@@ -153,7 +153,9 @@ def json_change_settings(pm_content_in_desktop_notifications: Optional[bool] = REQ(json_validator=check_bool, default=None),- desktop_icon_count_display: Optional[int] = REQ(json_validator=check_int, default=None),+ desktop_icon_count_display: Optional[int] = REQ(+ json_validator=check_int_in(UserProfile.DESKTOP_ICON_COUNT_DISPLAY_CHOICES), default=None+ ),realm_name_in_notifications: Optional[bool] = REQ(json_validator=check_bool, default=None),presence_enabled: Optional[bool] = REQ(json_validator=check_bool, default=None),enter_sends: Optional[bool] = REQ(json_validator=check_bool, default=None),