mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
Add notification at info-bar, and fix bug in visiting register/login page when user is already logged in.
This commit is contained in:
@@ -23,10 +23,14 @@ from seaserv import get_ccnetuser
|
||||
@csrf_protect
|
||||
@never_cache
|
||||
def login(request, template_name='registration/login.html',
|
||||
redirect_if_logged_in=None,
|
||||
redirect_field_name=REDIRECT_FIELD_NAME,
|
||||
authentication_form=AuthenticationForm):
|
||||
"""Displays the login form and handles the login action."""
|
||||
|
||||
if request.user.is_authenticated() and redirect_if_logged_in:
|
||||
return HttpResponseRedirect(reverse(redirect_if_logged_in))
|
||||
|
||||
redirect_to = request.REQUEST.get(redirect_field_name, '')
|
||||
|
||||
if request.method == "POST":
|
||||
|
@@ -30,7 +30,8 @@ from auth import views as auth_views
|
||||
urlpatterns = patterns('',
|
||||
url(r'^login/$',
|
||||
auth_views.login,
|
||||
{'template_name': 'registration/login.html'},
|
||||
{'template_name': 'registration/login.html',
|
||||
'redirect_if_logged_in': 'myhome'},
|
||||
name='auth_login'),
|
||||
url(r'^logout/$',
|
||||
auth_views.logout,
|
||||
|
Reference in New Issue
Block a user