forked from DGNum/gestioCOF
Fix need account si request.user has_permkfet.is_team
This commit is contained in:
parent
f1444b2462
commit
723a35b7ad
1 changed files with 6 additions and 0 deletions
|
@ -4,6 +4,7 @@ from __future__ import (absolute_import, division,
|
|||
print_function, unicode_literals)
|
||||
from builtins import *
|
||||
|
||||
from django.http import HttpResponseForbidden
|
||||
from kfet.backends import KFetBackend
|
||||
|
||||
class KFetAuthenticationMiddleware(object):
|
||||
|
@ -13,3 +14,8 @@ class KFetAuthenticationMiddleware(object):
|
|||
if temp_request_user:
|
||||
request.real_user = request.user
|
||||
request.user = temp_request_user
|
||||
if request.user.has_perm('kfet.is_team'):
|
||||
try:
|
||||
request.user.profile.account_kfet
|
||||
except RelatedObjectDoesNotExist:
|
||||
return HttpResponseForbidden
|
||||
|
|
Loading…
Reference in a new issue