Skip to content
Snippets Groups Projects
Commit 9151e93a authored by jan.bednarik's avatar jan.bednarik
Browse files

Fix expected behavior of User model

parent 0fd9f98b
Branches
No related tags found
No related merge requests found
...@@ -35,6 +35,9 @@ class AbstractUser(PermissionsMixin): ...@@ -35,6 +35,9 @@ class AbstractUser(PermissionsMixin):
) )
date_joined = models.DateTimeField(_("date joined"), default=timezone.now) date_joined = models.DateTimeField(_("date joined"), default=timezone.now)
USERNAME_FIELD = "sso_id"
REQUIRED_FIELDS = []
class Meta: class Meta:
abstract = True abstract = True
verbose_name = _("user") verbose_name = _("user")
...@@ -49,6 +52,22 @@ class AbstractUser(PermissionsMixin): ...@@ -49,6 +52,22 @@ class AbstractUser(PermissionsMixin):
"""Return the short name for the user.""" """Return the short name for the user."""
return self.first_name 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): class AbstractTeam(models.Model):
name = models.CharField(max_length=250, unique=True) name = models.CharField(max_length=250, unique=True)
......
...@@ -13,7 +13,7 @@ def read(fname): ...@@ -13,7 +13,7 @@ def read(fname):
setup( setup(
name="pirates", name="pirates",
version="0.2.1", version="0.3.0",
license="MIT", license="MIT",
description="Django app for users, teamds and groups.", description="Django app for users, teamds and groups.",
long_description=read("README.md"), long_description=read("README.md"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment