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() email = (request.form.get("email") or "").strip().lower()
password = request.form.get("password") or "" password = request.form.get("password") or ""
password_repeat = request.form.get("password_repeat") 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: 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") flash("Bitte alle Felder ausfüllen.", "error")
@@ -1936,7 +1937,8 @@ def register():
try: try:
existing_users = user_store.get_all_users() or [] existing_users = user_store.get_all_users() or []
is_first_user = len(existing_users) == 0 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") flash("Benutzer konnte nicht erstellt werden.", "error")
return redirect(url_for("register")) return redirect(url_for("register"))
+15 -5
View File
@@ -55,13 +55,18 @@
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
gap: 0.6rem; gap: 0.6rem;
margin: 0.35rem 0 1rem; margin: 1.1rem 0 1.3rem;
color: #244f66; color: #244f66;
font-size: 0.95rem;
cursor: pointer;
} }
.checkbox-line input { .checkbox-line input[type="checkbox"] {
width: auto; width: 18px;
margin-top: 0.2rem; height: 18px;
margin-top: 0.1rem;
accent-color: #0a5f8f;
cursor: pointer;
} }
.auth-btn { .auth-btn {
@@ -117,8 +122,13 @@
<label for="password_repeat">Passwort wiederholen</label> <label for="password_repeat">Passwort wiederholen</label>
<input id="password_repeat" name="password_repeat" type="password" autocomplete="new-password" required> <input id="password_repeat" name="password_repeat" type="password" autocomplete="new-password" required>
</div> </div>
<label class="checkbox-line">
<input id="marketing_opt_in" name="marketing_opt_in" type="checkbox">
<span>Ja, ich möchte E-Mails zu Produktupdates, Neuigkeiten und Marketinginformationen erhalten. (Abmeldung jederzeit möglich)</span>
</label>
<button class="auth-btn" type="submit">Konto erstellen</button> <button class="auth-btn" type="submit">Konto erstellen</button>
</form> </form>
<p class="auth-meta">Bereits registriert? <a href="{{ url_for('login') }}">Zum Login</a></p> <p class="auth-meta">Bereits registriert? <a href="{{ url_for('login') }}">Zum Login</a></p>
</section> </section>
{% endblock %} {% endblock %}