Last active
August 29, 2015 13:57
Revisions
-
skyleronken revised this gist
Mar 17, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ 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') ) -
skyleronken renamed this gist
Mar 17, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # From within resources.py @wraps(func) def wrapper(self, request, *args, **kwargs): -
skyleronken created this gist
Mar 17, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ @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 print request.user.is_authenticated() raise ImmediateHttpResponse( HttpUnauthorized('Log in required for this action') ) return func(self, request, *args, **kwargs)