Skip to content

Instantly share code, notes, and snippets.

@ddahan
Created January 4, 2017 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddahan/ae8bb4756bf8cda76eb7edf2eb7bb95a to your computer and use it in GitHub Desktop.
Save ddahan/ae8bb4756bf8cda76eb7edf2eb7bb95a to your computer and use it in GitHub Desktop.
# models.py
class User(AbstractBaseUser, PermissionsMixin):
# ...
def is_owner(self):
''' Retourne True si cet utilisateur est lié à un BizProfile '''
try:
self.bizprofile
return True
except:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment