[llvm-commits] [zorg] r125869 - in /zorg/trunk/llvmlab: llvmlab/ui/templates/login.html tests/basic.py
Daniel Dunbar
daniel at zuster.org
Fri Feb 18 08:41:05 PST 2011
Author: ddunbar
Date: Fri Feb 18 10:41:05 2011
New Revision: 125869
URL: http://llvm.org/viewvc/llvm-project?rev=125869&view=rev
Log:
llvmlab: Make login page display something more sensible if already logged in.
Modified:
zorg/trunk/llvmlab/llvmlab/ui/templates/login.html
zorg/trunk/llvmlab/tests/basic.py
Modified: zorg/trunk/llvmlab/llvmlab/ui/templates/login.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/templates/login.html?rev=125869&r1=125868&r2=125869&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/templates/login.html (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/templates/login.html Fri Feb 18 10:41:05 2011
@@ -1,6 +1,14 @@
{% extends "layout.html" %}
{% block title %}login{% endblock %}
{% block body %}
+
+{% if session.logged_in %}
+
+You are already logged in. Would you like to <a href="{{ url_for('logout')
+}}">logout</a>?
+
+{% else %}
+
<h2>Login</h2>
{% if error %}
<p class=error><strong>Error:</strong> {{ error }}
@@ -12,4 +20,7 @@
<dd><input type=submit value=Login></dd>
</dl>
</form>
+
+{% endif %}
+
{% endblock %}
Modified: zorg/trunk/llvmlab/tests/basic.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/tests/basic.py?rev=125869&r1=125868&r2=125869&view=diff
==============================================================================
--- zorg/trunk/llvmlab/tests/basic.py (original)
+++ zorg/trunk/llvmlab/tests/basic.py Fri Feb 18 10:41:05 2011
@@ -40,6 +40,10 @@
# Log in as the test admin user.
rv = self.login("admin", "admin")
assert "Logged In: <i>admin</i>""" in rv.data
+
+ # Check that the login page shows something sensible.
+ rv = self.app.get('/login')
+ assert """You are already logged in.""" in rv.data
# Check that we can access the users page now.
rv = self.app.get('/users')
More information about the llvm-commits
mailing list