parametrize site redirect URL

This commit is contained in:
Yax 2021-12-11 16:41:03 +01:00
parent 53a7fa90cb
commit aac1e817bb
4 changed files with 4 additions and 2 deletions

View file

@ -35,6 +35,7 @@ class ConfigParameter(Enum):
SITE_URL = "site.url"
SITE_TOKEN = "site.token"
SITE_ADMIN_EMAIL = "site.admin_email"
SITE_REDIRECT = "site.redirect"
class Config:

View file

@ -42,7 +42,7 @@ def new_form_comment():
# add a row to Comment table
dao.create_comment(url, author_name, author_site, author_gravatar, message)
return redirect("/redirect/", code=302)
return redirect(app.config.get("SITE_REDIRECT"), code=302)
def check_form_data(d):