mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
settings: Add setting for marking resolved-topic notices as read.
This commit adds a new personal setting `resolved_topic_notice_auto_read_policy` which controls how resolved-topic notices are marked as read for a user. Fixes #33599.
This commit is contained in:
committed by
Tim Abbott
parent
3d33a05455
commit
70e45f45c0
@@ -57,6 +57,7 @@ from zerver.models.realms import (
|
||||
MessageEditHistoryVisibilityPolicyEnum,
|
||||
OrgTypeEnum,
|
||||
)
|
||||
from zerver.models.users import ResolvedTopicNoticeAutoReadPolicyEnum
|
||||
from zerver.views.user_settings import check_settings_values
|
||||
|
||||
|
||||
@@ -696,6 +697,16 @@ def update_realm_user_settings_defaults(
|
||||
web_navigate_to_sent_message: Json[bool] | None = None,
|
||||
web_suggest_update_timezone: Json[bool] | None = None,
|
||||
hide_ai_features: Json[bool] | None = None,
|
||||
resolved_topic_notice_auto_read_policy: Annotated[
|
||||
str | None,
|
||||
AfterValidator(
|
||||
lambda val: parse_enum_from_string_value(
|
||||
val,
|
||||
"resolved_topic_notice_auto_read_policy",
|
||||
ResolvedTopicNoticeAutoReadPolicyEnum,
|
||||
)
|
||||
),
|
||||
] = None,
|
||||
) -> HttpResponse:
|
||||
if notification_sound is not None or email_notifications_batching_period_seconds is not None:
|
||||
check_settings_values(notification_sound, email_notifications_batching_period_seconds)
|
||||
|
||||
@@ -14,6 +14,7 @@ from django.utils.safestring import SafeString
|
||||
from django.utils.translation import gettext as _
|
||||
from django.utils.translation import gettext_lazy
|
||||
from pydantic import Json
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
|
||||
from confirmation.models import (
|
||||
Confirmation,
|
||||
@@ -48,11 +49,13 @@ from zerver.lib.typed_endpoint import typed_endpoint, typed_endpoint_without_par
|
||||
from zerver.lib.typed_endpoint_validators import (
|
||||
check_int_in_validator,
|
||||
check_string_in_validator,
|
||||
parse_enum_from_string_value,
|
||||
timezone_validator,
|
||||
)
|
||||
from zerver.lib.upload import upload_avatar_image
|
||||
from zerver.models import EmailChangeStatus, UserProfile
|
||||
from zerver.models.realms import avatar_changes_disabled, name_changes_disabled
|
||||
from zerver.models.users import ResolvedTopicNoticeAutoReadPolicyEnum
|
||||
from zerver.views.auth import redirect_to_deactivation_notice
|
||||
from zproject.backends import check_password_strength, email_belongs_to_ldap
|
||||
|
||||
@@ -307,6 +310,16 @@ def json_change_settings(
|
||||
web_navigate_to_sent_message: Json[bool] | None = None,
|
||||
web_suggest_update_timezone: Json[bool] | None = None,
|
||||
hide_ai_features: Json[bool] | None = None,
|
||||
resolved_topic_notice_auto_read_policy: Annotated[
|
||||
str | None,
|
||||
AfterValidator(
|
||||
lambda val: parse_enum_from_string_value(
|
||||
val,
|
||||
"resolved_topic_notice_auto_read_policy",
|
||||
ResolvedTopicNoticeAutoReadPolicyEnum,
|
||||
)
|
||||
),
|
||||
] = None,
|
||||
) -> HttpResponse:
|
||||
# UserProfile object is being refetched here to make sure that we
|
||||
# do not use stale object from cache which can happen when a
|
||||
|
||||
Reference in New Issue
Block a user