aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-03-02 15:47:20 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-03-02 15:47:20 +0000
commiteb9b5823265ed2641428b15fe406431c7a458c1c (patch)
tree6e407e3df6e99252ca7283df60c9c3c026375867
parent08bb520766fb3fdd8b2ac25d2a065fc4d1a1e4a2 (diff)
populate script now assocatiates a single EngagementEvent with a CAF
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/management/commands/populate_db.py6
-rw-r--r--ctrack/register/models.py10
2 files changed, 6 insertions, 10 deletions
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py
index 78efc1d..8a2ad84 100644
--- a/ctrack/organisations/management/commands/populate_db.py
+++ b/ctrack/organisations/management/commands/populate_db.py
@@ -139,6 +139,7 @@ class Command(BaseCommand):
etf1 = EngagementTypeFactory(descriptor="Information Notice")
etf2 = EngagementTypeFactory(descriptor="Designation Letter")
+ etf3 = EngagementTypeFactory(descriptor="CAF Submission")
ee1 = EngagementEventFactory.create(type=etf1, user=user, participants=[p1, p2])
ee2 = EngagementEventFactory.create(type=etf2, user=user, participants=[p3])
@@ -175,6 +176,11 @@ class Command(BaseCommand):
for _ in range(35)
]
+ # CAF submissions - they create EngagementEvents
+ ee3 = EngagementEventFactory.create(
+ type=etf3, user=user, participants=[inspectors[1], p2], related_caf=cafs[1]
+ )
+
# TODO - adapt this so that it records more than just Persons created
self.stdout.write(
self.style.SUCCESS(
diff --git a/ctrack/register/models.py b/ctrack/register/models.py
index 5f585c3..60733c5 100644
--- a/ctrack/register/models.py
+++ b/ctrack/register/models.py
@@ -37,16 +37,6 @@ class EngagementEvent(models.Model):
short_description = models.CharField(
max_length=50, help_text="Short description of the event"
)
- # TODO - Do we need an "inspector_engagement" field here?
- # We want an EngagementEvent to cover interactions between
- # Persons (industry people) and inspectors (Users). We don't want
- # to have to create Person() objects for each inspector, do we?
- # Actually, if we do, we could allow for the case where a ctrack user
- # is able to do delegated work for inspectors. So the task here is to
- # adapt the factories so half a dozen inspectors are created as Persons
- # and given the role of DfT Compliance Inspector, which have to be created
- # also. Then we can start building out the CAF factories to include stuff
- # list submission date, submission recipient, etc.
participants = models.ManyToManyField(Person)
user = models.ForeignKey(get_user_model(), on_delete=models.SET(get_sentinel_user))
date = models.DateTimeField()