changes to the register option to have an optin button for the marketing emails

This commit is contained in:
2026-08-24 23:08:49 +02:00
parent 92f7728dfd
commit ffe730cc50
2 changed files with 18 additions and 6 deletions
+3 -1
View File
@@ -1904,6 +1904,7 @@ def register():
email = (request.form.get("email") or "").strip().lower()
password = request.form.get("password") or ""
password_repeat = request.form.get("password_repeat") or ""
marketing_opt_in = True if request.form.get("marketing_opt_in") == "on" else False
if not username or not school_name or not contact_person or not email or not password or not password_repeat:
flash("Bitte alle Felder ausfüllen.", "error")
@@ -1936,7 +1937,8 @@ def register():
try:
existing_users = user_store.get_all_users() or []
is_first_user = len(existing_users) == 0
if not user_store.add_user(username, password, school_name, contact_person, email):
if not user_store.add_user(username, password, school_name, contact_person, email, marketing_opt_in=marketing_opt_in):
flash("Benutzer konnte nicht erstellt werden.", "error")
return redirect(url_for("register"))