re-parse MOTDs if required on init

This commit is contained in:
2025-11-27 19:56:17 +03:00
parent fca214dfcf
commit d0dfd3a4c3
3 changed files with 22 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ from flask import (
)
from .users import get_active_user, is_logged_in
from ..models import Users, PasswordResetLinks, MOTD
from ..constants import InfoboxKind
from ..constants import InfoboxKind, MOTD_BANNED_TAGS
from ..lib.babycode import babycode_to_html, BABYCODE_VERSION
from ..db import db
import secrets
@@ -73,7 +73,7 @@ def motd_editor_form():
data = {
'title': title,
'body_original_markup': orig_body,
'body_rendered': babycode_to_html(orig_body, banned_tags=['img', 'spoiler']),
'body_rendered': babycode_to_html(orig_body, banned_tags=MOTD_BANNED_TAGS),
'format_version': BABYCODE_VERSION,
'edited_at': int(time.time()),
}