mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 14:32:16 +00:00
Much versioning work
This commit is contained in:
@@ -19,8 +19,7 @@ from reversion import revisions as reversion
|
||||
from reversion.models import Version
|
||||
|
||||
|
||||
@reversion.register
|
||||
class Profile(AbstractUser): # TODO move to versioning - currently get import errors with that
|
||||
class Profile(AbstractUser):
|
||||
initials = models.CharField(max_length=5, null=True, blank=False)
|
||||
phone = models.CharField(max_length=13, blank=True, default='')
|
||||
api_key = models.CharField(max_length=40, blank=True, editable=False, default='')
|
||||
@@ -29,6 +28,8 @@ class Profile(AbstractUser): # TODO move to versioning - currently get import e
|
||||
last_emailed = models.DateTimeField(blank=True, null=True)
|
||||
dark_theme = models.BooleanField(default=False)
|
||||
|
||||
reversion_hide = True
|
||||
|
||||
@classmethod
|
||||
def make_api_key(cls):
|
||||
size = 20
|
||||
@@ -66,11 +67,6 @@ class Profile(AbstractUser): # TODO move to versioning - currently get import e
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def as_trainee(self):
|
||||
from training.models import Trainee
|
||||
return Trainee.objects.get(pk=self.pk)
|
||||
|
||||
|
||||
class RevisionMixin(object):
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user