diff options
author | 2010-08-06 17:14:51 +0300 | |
---|---|---|
committer | 2010-08-06 17:14:51 +0300 | |
commit | f4b5dad93b9c02b4fc4ac058cf4298b42e04b167 (patch) | |
tree | a476d187723cf9fb7c5f7aaf82091b710d29e2fc | |
parent | Added developer dashboard (diff) | |
download | gsoc2010-grumpy-f4b5dad93b9c02b4fc4ac058cf4298b42e04b167.tar.gz gsoc2010-grumpy-f4b5dad93b9c02b4fc4ac058cf4298b42e04b167.tar.bz2 gsoc2010-grumpy-f4b5dad93b9c02b4fc4ac058cf4298b42e04b167.zip |
Redirect away from account confirmation page when account is registered
-rw-r--r-- | grumpy/webapp.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/grumpy/webapp.py b/grumpy/webapp.py index 68bb96f..dfb7972 100644 --- a/grumpy/webapp.py +++ b/grumpy/webapp.py @@ -112,16 +112,19 @@ def create_account(): db.session.commit() send_email(email, u'Gentoo Grumpy registration confirmation', \ render_template('email/registration.txt', user=user)) - flash(u'Profile successfully created') + flash(u'Account successfully created') return redirect(oid.get_next_url()) return render_template('create_account.html', next=oid.get_next_url()) -@app.route('/confirm-profile/<email>/') +@app.route('/confirm-account/<email>/') def confirm_account(email): user = User.query.filter_by(email=email).first() if not user: flash(u'Invalid email: "%s"' % email) return redirect(url_for('index')) + if user.regtoken is None: + flash(u'Account been already confirmed') + return redirect(url_for('index')) if user.regtoken != request.args.get('token'): flash(u'Invalid token specified') return render_template('confirm_account.html', success=False) |