mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Simplify and "fix" render_old_messages management command.
The command to render old messages now looks for all messages not matching the bugdown version, and it no longer directly calls into model code. We should still be extremely cautious about using this code.
This commit is contained in:
@@ -213,3 +213,19 @@ class MessageDict(object):
|
||||
|
||||
return obj
|
||||
|
||||
def re_render_content_for_management_command(message):
|
||||
# type: (Message) -> None
|
||||
|
||||
'''
|
||||
Please avoid using this function, as its only used in a management command that
|
||||
is somewhat deprecated.
|
||||
'''
|
||||
assert Message.need_to_render_content(message.rendered_content,
|
||||
message.rendered_content_version,
|
||||
bugdown.version)
|
||||
|
||||
rendered_content = message.render_markdown(message.content)
|
||||
message.rendered_content = rendered_content
|
||||
message.rendered_content_version = bugdown.version
|
||||
message.save_rendered_content()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user