Don't allow resets of Service Acccounts that don't need a password

This commit is contained in:
2011-01-07 09:15:53 +00:00
parent ade8ee1c69
commit 17923ca2f2
2 changed files with 3 additions and 2 deletions

View File

@@ -215,7 +215,8 @@ def service_reset(request, serviceid=0):
except ServiceAccount.DoesNotExist:
return redirect('sso.views.profile')
if not acc.active:
# If the account is inactive, or the service doesn't require a password, redirect
if not acc.active or ('require_password' in acc.service.settings and not acc.service.settings['require_password']):
return redirect('sso.views.profile')
if acc.user == request.user: