mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Few fixes for live issues discovered with the API password setting fuction
This commit is contained in:
@@ -20,7 +20,7 @@ urlpatterns = patterns('',
|
||||
(r'^profile/log/eveapi/(?P<userid>\d+)/$', views.eveapi_log),
|
||||
(r'^profile/characters$', views.characters),
|
||||
(r'^profile/characters/(?P<charid>.*)/$', views.characters),
|
||||
(r'^profile/apipassword/', views.set_apipassword),
|
||||
(r'^profile/apipassword/', views.set_apipasswd),
|
||||
(r'^users/(?P<username>.*)/$', views.user_view),
|
||||
(r'^users/$', views.user_lookup),
|
||||
)
|
||||
|
||||
@@ -348,10 +348,13 @@ def set_apipasswd(request):
|
||||
if request.method == 'POST':
|
||||
form = APIPasswordForm(request.POST)
|
||||
if form.is_valid():
|
||||
profile = request.user.get_profile()
|
||||
profile.api_service_password = hashlib.sha1(form.cleaned_data['password']).hexdigest()
|
||||
profile.save()
|
||||
request.user.message_set.create(message="Your API Services password has been set.")
|
||||
return HttpResponseRedirect(reverse('sso.views.profile')) # Redirect after POST
|
||||
else:
|
||||
form = APIPasswordForm(defaults) # An unbound form
|
||||
form = APIPasswordForm() # An unbound form
|
||||
|
||||
return render_to_response('sso/apipassword.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p>This service will reset your password for all API Services. If you wish to continue please click the link
|
||||
below.</p>
|
||||
|
||||
<form action="{% url sso.views.set_apipassword %}" method="post">
|
||||
<form action="{% url sso.views.set_apipasswd %}" method="post">
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user