changes to the register option to have an optin button for the marketing emails
This commit is contained in:
+3
-1
@@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user