SHARE
TWEET

Untitled

a guest Jun 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
  2.     return super(CursorDebugWrapper, self).execute(sql, params)
  3.   File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
  4.     return self.cursor.execute(sql, params)
  5.   File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
  6.     six.reraise(dj_exc_type, dj_exc_value, traceback)
  7.   File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
  8.     return self.cursor.execute(sql)
  9.      
  10. from django.db import models
  11. from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
  12. from ..managers.user import UserManager
  13.  
  14.  
  15. class User(AbstractBaseUser, PermissionsMixin):
  16.     # Email identifier, primary key, unique identifier for the user.
  17.     email = models.EmailField(verbose_name='email address', max_length=254, unique=True, db_index=True)
  18.     is_admin = models.BooleanField(default=False)
  19.     is_active = models.BooleanField(default=False)
  20.     objects = UserManager()
  21.  
  22.     USERNAME_FIELD = 'email'
  23.     REQUIRED_FIELDS = []
  24.  
  25.     class Meta:
  26.         verbose_name = 'User'
  27.         app_label = "users"
  28.  
  29.     def __unicode__(self):
  30.         return self.email
  31.  
  32.     @property
  33.     def get_full_name(self):
  34.         return self.email
  35.  
  36.     @property
  37.     def get_short_name(self):
  38.         return self.email
  39.  
  40.     def has_module_perms(self, app_label):
  41.         """
  42.         Does the user have permissions to view the app `app_label`
  43.         """
  44.         # Simplest possible answer: Yes, always
  45.         return True
  46.  
  47.     @property
  48.     def is_staff(self):
  49.         # Simplest possible answer: All admins are staff
  50.         return self.is_admin
  51.      
  52. AUTH_USER_MODEL = 'users.User'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top