Fix navbar disappearing when saving customize form
Browser textarea submissions convert \n to \r\n, causing the template comparison against DEFAULT_TEMPLATE to always fail. This saved the bare skeleton as a custom template, overriding the default navbar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7c225145f0
commit
6070e09834
1 changed files with 1 additions and 1 deletions
|
|
@ -528,7 +528,7 @@ def handle_style_submit(body):
|
|||
template = body.get("template", [""])[0]
|
||||
name = body.get("site_name", ["tinyweb"])[0].strip()
|
||||
sharing = "1" if body.get("sharing_enabled") else "0"
|
||||
set_setting("custom_template", template if template.strip() != DEFAULT_TEMPLATE.strip() else "")
|
||||
set_setting("custom_template", template if template.strip().replace("\r\n", "\n") != DEFAULT_TEMPLATE.strip() else "")
|
||||
set_setting("site_name", name or "tinyweb")
|
||||
set_setting("sharing_enabled", sharing)
|
||||
return handle_style_form("Saved.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue