mirror of https://github.com/zulip/zulip.git
message edit: Move new topic non-empty check to view.
This commit is contained in:
parent
0900ca5353
commit
211a166abc
|
@ -2440,9 +2440,6 @@ def do_update_message(user_profile, message_id, subject, propagate_mode, content
|
|||
|
||||
if subject is not None:
|
||||
orig_subject = message.subject
|
||||
subject = subject.strip()
|
||||
if subject == "":
|
||||
raise JsonableError(_("Topic can't be empty"))
|
||||
subject = truncate_topic(subject)
|
||||
event["orig_subject"] = orig_subject
|
||||
event["propagate_mode"] = propagate_mode
|
||||
|
|
|
@ -802,6 +802,10 @@ def update_message_backend(request, user_profile,
|
|||
return json_error(_("Nothing to change"))
|
||||
if not user_profile.realm.allow_message_editing:
|
||||
return json_error(_("Your organization has turned off message editing."))
|
||||
if subject is not None:
|
||||
subject = subject.strip()
|
||||
if subject == "":
|
||||
raise JsonableError(_("Topic can't be empty"))
|
||||
do_update_message(user_profile, message_id, subject, propagate_mode, content)
|
||||
return json_success()
|
||||
|
||||
|
|
Loading…
Reference in New Issue