diff --git a/zerver/actions/realm_settings.py b/zerver/actions/realm_settings.py index a28e094b44..2e7b87f329 100644 --- a/zerver/actions/realm_settings.py +++ b/zerver/actions/realm_settings.py @@ -15,10 +15,7 @@ from zerver.actions.user_groups import update_users_in_full_members_system_group from zerver.actions.user_settings import do_delete_avatar_image, send_user_email_update_event from zerver.lib.cache import flush_user_profile from zerver.lib.create_user import get_display_email_address -from zerver.lib.message import ( - parse_message_content_edit_or_delete_limit, - update_first_visible_message_id, -) +from zerver.lib.message import parse_message_time_limit_setting, update_first_visible_message_id from zerver.lib.send_email import FromAddress, send_email_to_admins from zerver.lib.sessions import delete_user_sessions from zerver.lib.user_counts import realm_user_count_by_role @@ -124,9 +121,9 @@ def do_set_realm_property( def parse_and_set_setting_value_if_required( realm: Realm, setting_name: str, value: Union[int, str], *, acting_user: Optional[UserProfile] ) -> Tuple[Optional[int], bool]: - parsed_value = parse_message_content_edit_or_delete_limit( + parsed_value = parse_message_time_limit_setting( value, - Realm.MESSAGE_CONTENT_EDIT_OR_DELETE_LIMIT_SPECIAL_VALUES_MAP, + Realm.MESSAGE_TIME_LIMIT_SETTING_SPECIAL_VALUES_MAP, setting_name=setting_name, ) diff --git a/zerver/lib/message.py b/zerver/lib/message.py index d98aacdd61..8f5346768d 100644 --- a/zerver/lib/message.py +++ b/zerver/lib/message.py @@ -1614,7 +1614,7 @@ def wildcard_mention_allowed(sender: UserProfile, stream: Stream) -> bool: raise AssertionError("Invalid wildcard mention policy") -def parse_message_content_edit_or_delete_limit( +def parse_message_time_limit_setting( value: Union[int, str], special_values_map: Mapping[str, Optional[int]], *, diff --git a/zerver/models.py b/zerver/models.py index 0229efe55b..fd7e1fd6e2 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -464,7 +464,7 @@ class Realm(models.Model): # type: ignore[django-manager-missing] # django-stub DEFAULT_MESSAGE_CONTENT_DELETE_LIMIT_SECONDS = ( 600 # if changed, also change in admin.js, setting_org.js ) - MESSAGE_CONTENT_EDIT_OR_DELETE_LIMIT_SPECIAL_VALUES_MAP = { + MESSAGE_TIME_LIMIT_SETTING_SPECIAL_VALUES_MAP = { "unlimited": None, } message_content_delete_limit_seconds = models.PositiveIntegerField(