aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-02-19 21:22:21 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-02-19 21:22:21 +0000
commitac2a715c0bc38e8a03640c604b8ed082456b2109 (patch)
treedec73bfcbf7920e18e94c493484e7368641d3387 /ctrack/organisations/models.py
parentafed43baeb9b4f9ee9f449b7be4e8a89a65ce9a8 (diff)
new migrations and working through factory issue
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/models.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py
index 631d441..a04fa32 100644
--- a/ctrack/organisations/models.py
+++ b/ctrack/organisations/models.py
@@ -62,18 +62,18 @@ class Person(models.Model):
updated_by = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
clearance = models.IntegerField(choices=CLEARANCE_LEVEL, default=1)
clearance_sponsor = models.CharField(max_length=100, blank=True)
- clearance_start_date = models.DateField(blank=True)
- clearance_last_checked = models.DateField(blank=True)
- clearance_expiry = models.DateField(blank=True)
+ clearance_start_date = models.DateField(blank=True, null=True)
+ clearance_last_checked = models.DateField(blank=True, null=True)
+ clearance_expiry = models.DateField(blank=True, null=True)
active = models.BooleanField(default=True)
- date_ended = models.DateField(blank=True)
+ date_ended = models.DateField(blank=True, null=True)
predecessor = models.ForeignKey(
- "self", blank=True, on_delete=models.CASCADE, related_name="previous_person"
+ "self", blank=True, on_delete=models.CASCADE, related_name="previous_person", null=True
)
- comments = models.TextField(max_length=1000)
+ comments = models.TextField(max_length=1000, blank=True)
def __str__(self):
- return self.name
+ return f"{self.first_name} {self.last_name}"
def get_organisation_name(self):
return self.organisation.name