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

Change __str__ of models.User

parent 0cb7d04c
......@@ -160,18 +160,23 @@ class User(AbstractUser):
return self._is_active
def __str__(self):
prefix = ''
name = ''
if self.is_superuser:
prefix = 'ADMIN '
elif self.user_type == 'oidcuser':
name += 'ADMIN '
if self.user_type == 'oidcuser':
if not self.is_active:
prefix = 'DEACTIVATED USER '
else:
prefix = 'USER '
name += 'DEACTIVATED '
name += 'USER '
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):
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