mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 18:34:18 +00:00
Add indentation
This commit is contained in:
parent
686b621d54
commit
9cca7de035
@ -1,5 +1,5 @@
|
|||||||
from flask import flash, redirect, render_template, request, url_for
|
from flask import flash, redirect, render_template, request, url_for
|
||||||
from flask_login import login_required, login_user, logout_user
|
from flask_login import login_required, login_user, logout_user, current_user
|
||||||
from . import auth
|
from . import auth
|
||||||
from .. import db
|
from .. import db
|
||||||
from .forms import LoginForm, PasswordResetRequestForm, RegistrationForm
|
from .forms import LoginForm, PasswordResetRequestForm, RegistrationForm
|
||||||
@ -32,6 +32,8 @@ def logout():
|
|||||||
|
|
||||||
@auth.route('/register', methods=['GET', 'POST'])
|
@auth.route('/register', methods=['GET', 'POST'])
|
||||||
def register():
|
def register():
|
||||||
|
if not current_user.is_anonymous:
|
||||||
|
return redirect(url_for('main.index'))
|
||||||
form = RegistrationForm()
|
form = RegistrationForm()
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
user = User(email=form.email.data, username=form.username.data,
|
user = User(email=form.email.data, username=form.username.data,
|
||||||
@ -40,7 +42,7 @@ def register():
|
|||||||
db.session.commit()
|
db.session.commit()
|
||||||
flash('Successfully registered! You can now login.')
|
flash('Successfully registered! You can now login.')
|
||||||
return redirect(url_for('auth.login'))
|
return redirect(url_for('auth.login'))
|
||||||
return render_template('auth/register.html.j2')
|
return render_template('auth/register.html.j2', form=form)
|
||||||
|
|
||||||
|
|
||||||
@auth.route('/reset', methods=['GET', 'POST'])
|
@auth.route('/reset', methods=['GET', 'POST'])
|
||||||
|
Loading…
Reference in New Issue
Block a user