Fix some oddities in secauth.py
- Legacy-Id: 6934
This commit is contained in:
parent
77e03c7355
commit
e1025e67ae
|
@ -41,16 +41,14 @@ class SecAuthMiddleware(object):
|
|||
# need to initialize user, it doesn't get set when running tests for example
|
||||
|
||||
if request.path.startswith('/secr/'):
|
||||
user = ''
|
||||
request.user_is_secretariat = False
|
||||
|
||||
if request.user.is_anonymous():
|
||||
return render_to_response('401.html', {'user':user})
|
||||
|
||||
if 'REMOTE_USER' in request.META:
|
||||
# do custom auth
|
||||
if has_role(request.user,'Secretariat'):
|
||||
request.user_is_secretariat = True
|
||||
if request.user.is_anonymous():
|
||||
return render_to_response('401.html')
|
||||
|
||||
# do custom check
|
||||
if has_role(request.user, 'Secretariat'):
|
||||
request.user_is_secretariat = True
|
||||
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in a new issue