Commit 50a9d56a authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Change __str__ of models.User

parent 0cb7d04c
...@@ -160,18 +160,23 @@ class User(AbstractUser): ...@@ -160,18 +160,23 @@ class User(AbstractUser):
return self._is_active return self._is_active
def __str__(self): def __str__(self):
prefix = '' name = ''
if self.is_superuser: if self.is_superuser:
prefix = 'ADMIN ' name += 'ADMIN '
elif self.user_type == 'oidcuser': if self.user_type == 'oidcuser':
if not self.is_active: if not self.is_active:
prefix = 'DEACTIVATED USER ' name += 'DEACTIVATED '
else: name += 'USER '
prefix = 'USER '
elif self.user_type == 'apiclient': elif self.user_type == 'apiclient':
prefix = 'APICLIENT ' name += 'APICLIENT '
if self.user_type == 'oidcuser':
name += self.profile_name
else:
name += self.name
return prefix+self.username return name
def msg(self, msg): def msg(self, msg):
return '[{}] {}'.format(self, msg) return '[{}] {}'.format(self, msg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment