mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
If user is logged in and visits / /sign-in or /register they will
be redirected to choose service.
This commit is contained in:
@@ -4,9 +4,12 @@ from flask import (
|
||||
render_template,
|
||||
redirect,
|
||||
session,
|
||||
abort
|
||||
abort,
|
||||
url_for
|
||||
)
|
||||
|
||||
from flask.ext.login import current_user
|
||||
|
||||
from client.errors import HTTPError
|
||||
|
||||
from app.main import main
|
||||
@@ -22,6 +25,9 @@ from app.notify_client.sender import send_sms_code, send_email_code
|
||||
|
||||
@main.route('/register', methods=['GET', 'POST'])
|
||||
def register():
|
||||
if current_user and current_user.is_authenticated():
|
||||
return redirect(url_for('main.choose_service'))
|
||||
|
||||
form = RegisterUserForm(users_dao.get_user_by_email)
|
||||
|
||||
if form.validate_on_submit():
|
||||
|
||||
Reference in New Issue
Block a user