diff options
author | Marian Sigler <m@qjym.de> | 2012-09-27 18:37:11 +0200 |
---|---|---|
committer | Marian Sigler <m@qjym.de> | 2012-09-27 18:37:11 +0200 |
commit | 0722c5e49e29ad6eab2d23f0e8f3d59efb52bd2e (patch) | |
tree | ca743597e8b3685577b21c2d4405e546ee48acb5 | |
parent | da2882e6cbfb0e267475a4440a8efb486ff0f1b6 (diff) | |
parent | 5945702d282a6a1813538eee0503b3ebcac3ee0c (diff) | |
download | web-0722c5e49e29ad6eab2d23f0e8f3d59efb52bd2e.tar.gz web-0722c5e49e29ad6eab2d23f0e8f3d59efb52bd2e.tar.bz2 web-0722c5e49e29ad6eab2d23f0e8f3d59efb52bd2e.zip |
Merge branch 'master' of ssh://git.spline.de/account-web
Conflicts:
templates/base.html
-rw-r--r-- | app.py | 17 | ||||
-rw-r--r-- | templates/base.html | 2 | ||||
-rw-r--r-- | templates/index.html | 4 |
3 files changed, 11 insertions, 12 deletions
@@ -47,13 +47,16 @@ def read_blacklist(): @app.route('/', methods=['GET', 'POST']) @templated('index.html') def index(): - form = LoginForm(request.form) - if request.method == 'POST' and form.validate(): - if login_user(form.username.data, form.password.data): - flash(u'Erfolgreich eingeloggt', 'success') - return redirect(url_for('settings')) - else: - flash(u'Ungültiger Benutzername und/oder Passwort', 'error') + if not g.user: + form = LoginForm(request.form) + if request.method == 'POST' and form.validate(): + if login_user(form.username.data, form.password.data): + flash(u'Erfolgreich eingeloggt', 'success') + return redirect(url_for('settings')) + else: + flash(u'Ungültiger Benutzername und/oder Passwort', 'error') + else: + return redirect(url_for('settings')) return {'form': form} diff --git a/templates/base.html b/templates/base.html index aa7ff36..5aaa9ff 100644 --- a/templates/base.html +++ b/templates/base.html @@ -25,7 +25,7 @@ <nav id="mainnav"> <ul> <li><a href="http://spline.de">spline.de</a></li> - <li><a href="{{ url_for('about') }}">Über spline accounts</a></li> + <li><a href="{{ url_for('about') }}">FAQ</a></li> </ul> </nav> diff --git a/templates/index.html b/templates/index.html index 6fae303..3e192e5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,9 +2,6 @@ {%- from '_macros.html' import render_field %} {%- block content %} -{%- if g.user %} -<p>Hallo {{ session.username }}. <a href="{{ url_for('settings') }}">Einstellungen</a></p> -{%- else %} <form action="{{ url_for('index') }}" method="post" class="form-horizontal"> <h2>Login</h2> <p> @@ -20,6 +17,5 @@ <p class="form-actions"><a href="/register">Account erstellen</a></div> <p class="form-actions"><a href="/lost_password">Passwort vergessen</a></div> </form> -{%- endif %} {%- endblock %} |