You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
390 B

from hc.accounts.models import Profile
class TeamAccessMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
if not request.user.is_authenticated:
return self.get_response(request)
request.profile = Profile.objects.for_user(request.user)
return self.get_response(request)