Created
May 22, 2015 11:58
-
-
Save kitsunde/c567417f6672517b0390 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
class IsAuthenticated(object): | |
def __init__(self, origin): | |
self.origin = origin | |
def __nonzero__(self): | |
raise Exception("lol noob") | |
def __call__(self, *args, **kwargs): | |
return self.origin._noob_is_authenticated() | |
class MartinsUser(User): | |
def __init__(self, *args, **kwargs): | |
super(MartinsUser, self).__init__(*args, **kwargs) | |
self._noob_is_authenticated = self.is_authenticated | |
self.is_authenticated = IsAuthenticated(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment