Exemplo n.º 1
0
 def final(self, request, response, *args, **kargs):
     """
     Clear the current user singleton to make sure it doesn't leak
     """
     CurrentUserSingleton.set_user(None)
     return super(ModelMixin, self).final(request, response, *args, **kargs)
Exemplo n.º 2
0
 def initial(self, request, *args, **kwargs):
     """
     Set the currently authenticated user on the resource
     """
     CurrentUserSingleton.set_user(request.user)
     return super(ModelMixin, self).initial(request, *args, **kwargs)