Permalink
Browse files

Only show logout button if logged in.

  • Loading branch information...
1 parent e63c730 commit 670cf5dbfecb146fab4c01f58415b1b84beba548 @stefanv committed Nov 19, 2011
@@ -182,7 +182,10 @@ def _render(self, message=None):
)
def get(self):
- self._render()
+ if self.current_user:
+ self.redirect(self.get_argument('next', default='/'))
+ else:
+ self._render()
def post(self):
pwd = self.get_argument('password', default=u'')
@@ -23,7 +23,9 @@
<div id="header">
<span id="ipython_notebook"><h1>IPython Notebook</h1></span>
<span id="login_widget">
- <button id="logout">Logout</button>
+ {% if current_user and current_user != 'anonymous' %}
+ <button id="logout">Logout</button>
+ {% end %}
</span>
{% block header %}
{% end %}

0 comments on commit 670cf5d

Please sign in to comment.