add working confirmation
This commit is contained in:
8
auth.py
8
auth.py
@@ -1,7 +1,6 @@
|
||||
from datetime import datetime
|
||||
import functools
|
||||
import logging
|
||||
from django import db
|
||||
|
||||
from flask import (
|
||||
Blueprint, flash, g, redirect, render_template, request, session, url_for
|
||||
@@ -31,7 +30,8 @@ def register():
|
||||
error = 'Password is required.'
|
||||
elif not email:
|
||||
error = 'Email is required.'
|
||||
# TODO: check passwrd complexity
|
||||
elif password.lower()== password or password.upper()==password or password.isdigit() or len(password)<=8: #check passwrd complexity
|
||||
error = 'Bedingungen für passwort nicht erfüllt.'
|
||||
|
||||
if error is None:
|
||||
try:
|
||||
@@ -48,7 +48,7 @@ def register():
|
||||
confirm_url = url_for('auth.confirm_email', token=token, _external=True)
|
||||
logging.info("Generated confirmation url: %s", confirm_url)
|
||||
content = render_template('auth/confirm_mail.html', confirm_url=confirm_url, username=username, email=email)
|
||||
subject = "Registrierung für Planner von %s" % email
|
||||
subject = "Registrierung für ProPedal - Planner von %s" % email
|
||||
calendar_interface.send_mail("struebin.patrick@gmail.com", subject, content)
|
||||
|
||||
flash("Registrierung erfolgreich.")
|
||||
@@ -156,4 +156,4 @@ def confirm_email(token):
|
||||
db.commit()
|
||||
outcome= "User wurde erfolgreich freigeschaltet."
|
||||
|
||||
return render_template('auth/confirmation_successful.html', email=email, outcome=outcome)
|
||||
return render_template('auth/confirmation.html', email=email, outcome=outcome)
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
{% block content %}
|
||||
<h1>{% block title %}Benutzer mit email: {{email}}.{% endblock %}</h1>
|
||||
<h1>{% block title %}{{outcome}}.{% endblock %}</h1>
|
||||
<h1>{{outcome}}</h1>
|
||||
|
||||
{% endblock %}
|
||||
@@ -5,13 +5,18 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<label for="email">Email (Account login)</label>
|
||||
<input type="email" name="email" id="email" required>
|
||||
<label for="username">Name</label>
|
||||
<input name="username" id="username" required>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" required>
|
||||
<input type="submit" value="Register">
|
||||
</form>
|
||||
<a>
|
||||
<form method="post">
|
||||
<label for="email">Email (Account login)</label>
|
||||
<input type="email" name="email" id="email" required>
|
||||
<label for="username">Name</label>
|
||||
<input name="username" id="username" required>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" required>
|
||||
<br />
|
||||
<label for="email">Passwort muss Groß- und Kleinbuchstaben, Buchstaben und Zahlen enthalten und min. 8 Zeichen lang sein.</label>
|
||||
<br />
|
||||
<input type="submit" value="Register">
|
||||
</form>
|
||||
</a>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user