Complete supervisor model and start improving forms

This commit is contained in:
Ross
2022-11-28 09:50:07 +00:00
parent 653baa85ff
commit 747bf93373
27 changed files with 309 additions and 183 deletions
+6 -6
View File
@@ -638,13 +638,13 @@ class CidUserGroup(models.Model):
class UserUserGroup(models.Model):
name = models.CharField(blank=True, max_length=50)
archive = models.BooleanField(default=False)
name = models.CharField(blank=True, max_length=50, help_text="Name of the User Group")
archive = models.BooleanField(default=False, help_text="Archived groups remain on the test system but are not displayed by default")
users = models.ManyToManyField(
settings.AUTH_USER_MODEL,
blank=True,
related_name="user_groups"
related_name="user_groups",
)
def __str__(self) -> str:
@@ -686,10 +686,10 @@ class Supervisor(models.Model):
This can be linked with a user account.
"""
email = models.EmailField(blank=True, unique=True, help_text="The (nhs.net) email address of the supervisor")
name = models.CharField(max_length=255, blank=True, help_text="Name of the supervisor")
email = models.EmailField(unique=True, help_text="The (nhs.net) email address of the supervisor")
name = models.CharField(max_length=255, help_text="Name of the supervisor")
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True, blank=True, help_text="If the supervisor has an account on the test system that can be associated here")
site = models.ForeignKey("Site", on_delete=models.SET_NULL, null=True, blank=True)
site = models.ForeignKey("Site", on_delete=models.SET_NULL, null=True, blank=True, help_text="Hospital site at which the supervisor is based")
active = models.BooleanField(default=True)
def __str__(self) -> str: