mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
refactor: Simplify User person test
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import typing
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import AbstractUser
|
from django.contrib.auth.models import AbstractUser
|
||||||
from django.db import models
|
from django.db import models
|
||||||
@@ -28,12 +26,7 @@ class User(AbstractUser):
|
|||||||
"""
|
"""
|
||||||
Does this user have a linked :class:`Person` record?
|
Does this user have a linked :class:`Person` record?
|
||||||
"""
|
"""
|
||||||
try:
|
return hasattr(self, 'person')
|
||||||
person = self.person
|
|
||||||
return True
|
|
||||||
|
|
||||||
except AttributeError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
class Organisation(models.Model):
|
class Organisation(models.Model):
|
||||||
|
|||||||
Reference in New Issue
Block a user