mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Switch index view to use a django generic standard view
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
|
from django.core.urlresolvers import reverse
|
||||||
|
|
||||||
from sso import views
|
from sso import views
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
('^$', views.index),
|
('^$', views.profile),
|
||||||
(r'^profile/$', views.profile),
|
(r'^profile/$', views.profile),
|
||||||
(r'^profile/add/eveapi', views.eveapi_add),
|
(r'^profile/add/eveapi', views.eveapi_add),
|
||||||
(r'^profile/del/eveapi/$', views.eveapi_del),
|
(r'^profile/del/eveapi/$', views.eveapi_del),
|
||||||
@@ -21,3 +22,7 @@ urlpatterns = patterns('',
|
|||||||
(r'^users/(?P<username>.*)/$', views.user_view),
|
(r'^users/(?P<username>.*)/$', views.user_view),
|
||||||
(r'^users/$', views.user_lookup),
|
(r'^users/$', views.user_lookup),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
urlpatterns += patterns('django.views.generic.simple',
|
||||||
|
('^$', 'redirect_to', {'url': reverse('sso.views.profile')}),
|
||||||
|
)
|
||||||
|
|||||||
@@ -24,14 +24,6 @@ from eve_proxy.models import ApiAccessLog
|
|||||||
from sso.models import ServiceAccount, Service, SSOUser, ExistingUser, ServiceError
|
from sso.models import ServiceAccount, Service, SSOUser, ExistingUser, ServiceError
|
||||||
from sso.forms import EveAPIForm, UserServiceAccountForm, ServiceAccountResetForm, UserLookupForm, APIPasswordForm
|
from sso.forms import EveAPIForm, UserServiceAccountForm, ServiceAccountResetForm, UserLookupForm, APIPasswordForm
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
|
||||||
if request.user:
|
|
||||||
return redirect('sso.views.profile')
|
|
||||||
else:
|
|
||||||
return render_to_response('sso/index.html', context_instance=RequestContext(request))
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def profile(request):
|
def profile(request):
|
||||||
""" Displays the user's profile page """
|
""" Displays the user's profile page """
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="navigation">
|
<div id="navigation">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{% url sso.views.index %}">Home</a></li>
|
|
||||||
{% if request.user %}
|
{% if request.user %}
|
||||||
<li><a href="{% url sso.views.profile %}">Profile</a></li>
|
<li><a href="{% url sso.views.profile %}">Profile</a></li>
|
||||||
{% if "groups"|installed %}
|
{% if "groups"|installed %}
|
||||||
|
|||||||
Reference in New Issue
Block a user