diff --git a/pirates/models.py b/pirates/models.py index bceae18c0979ed31b92fead8f8267c012c4d4f3c..651d15e20da6211ff18e5d50b856d3ef03bb915e 100644 --- a/pirates/models.py +++ b/pirates/models.py @@ -35,6 +35,9 @@ class AbstractUser(PermissionsMixin): ) date_joined = models.DateTimeField(_("date joined"), default=timezone.now) + USERNAME_FIELD = "sso_id" + REQUIRED_FIELDS = [] + class Meta: abstract = True verbose_name = _("user") @@ -49,6 +52,22 @@ class AbstractUser(PermissionsMixin): """Return the short name for the user.""" return self.first_name + @property + def is_anonymous(self): + """ + Always return False. This is a way of comparing User objects to + anonymous users. + """ + return False + + @property + def is_authenticated(self): + """ + Always return True. This is a way to tell if the user has been + authenticated in templates. + """ + return True + class AbstractTeam(models.Model): name = models.CharField(max_length=250, unique=True) diff --git a/setup.py b/setup.py index ea21acf44419d8d69b161ef742eed8cf0acfd592..94bf339ee85ff84ba1ed34a7495db1245ed62fe3 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(fname): setup( name="pirates", - version="0.2.1", + version="0.3.0", license="MIT", description="Django app for users, teamds and groups.", long_description=read("README.md"),