Last active
August 29, 2015 13:57
-
-
Save skyleronken/9600434 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From within resources.py | |
@wraps(func) | |
def wrapper(self, request, *args, **kwargs): | |
if allowed is not None: | |
self.method_check(request, allowed) | |
if login_required and not self.Meta.authentication.is_authenticated(request): # This is the only change | |
raise ImmediateHttpResponse( | |
HttpUnauthorized('Log in required for this action') | |
) | |
return func(self, request, *args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment