aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-02 10:29:22 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-02 10:29:22 +0100
commitb5635e276781810dc6ae0a608c64a00e4a951cbb (patch)
tree6c5de6ca3a1aac2ba6f56cfffd07fe5efdd3409a
parentc3fd7a10d270d408b7661501c3c3023d602f7054 (diff)
tidying
-rw-r--r--ctrack/core/utils.py7
-rw-r--r--ctrack/register/forms.py3
-rw-r--r--ctrack/register/migrations/0003_auto_20201001_1036.py39
-rw-r--r--ctrack/register/models.py6
-rw-r--r--ctrack/register/templates/register/engagementevent_form.html5
5 files changed, 52 insertions, 8 deletions
diff --git a/ctrack/core/utils.py b/ctrack/core/utils.py
index 3c54245..e239120 100644
--- a/ctrack/core/utils.py
+++ b/ctrack/core/utils.py
@@ -201,8 +201,8 @@ def populate_db(**kwargs):
)
inspector_user.groups.add(cct_staff_group)
- etf1 = EngagementTypeFactory(descriptor="Information Notice")
- etf2 = EngagementTypeFactory(descriptor="Designation Letter")
+ etf1 = EngagementTypeFactory(descriptor="Information Notice", enforcement_instrument=True)
+ etf2 = EngagementTypeFactory(descriptor="Designation Letter", enforcement_instrument=True)
etf3 = EngagementTypeFactory(
descriptor="CAF - Initial Submission", enforcement_instrument=False
)
@@ -211,6 +211,9 @@ def populate_db(**kwargs):
descriptor="Video Conference", enforcement_instrument=False
)
etf6 = EngagementTypeFactory(descriptor="Email", enforcement_instrument=False)
+ etf7 = EngagementTypeFactory(descriptor="CAF - Initial Review Complete", enforcement_instrument=False)
+ etf8 = EngagementTypeFactory(descriptor="CAF - Peer Review")
+ EngagementTypeFactory(descriptor="CAF = Validation Complete")
EngagementEventFactory.create(type=etf1, user=user, participants=[p1, p2])
EngagementEventFactory.create(type=etf2, user=user, participants=[p3])
diff --git a/ctrack/register/forms.py b/ctrack/register/forms.py
index ee50a71..999ed9f 100644
--- a/ctrack/register/forms.py
+++ b/ctrack/register/forms.py
@@ -5,7 +5,7 @@ from django.shortcuts import get_object_or_404
from django.urls import reverse
from ctrack.organisations.models import Person, Organisation
-from ctrack.register.models import EngagementEvent
+from ctrack.register.models import EngagementEvent, EngagementType
class EngagementEventCreateForm(forms.ModelForm):
@@ -14,6 +14,7 @@ class EngagementEventCreateForm(forms.ModelForm):
org = get_object_or_404(Organisation, slug=org_slug)
cancel_redirect = reverse("core:home")
self.fields["participants"].queryset = Person.objects.filter(organisation__slug=org_slug)
+ self.fields["type"].queryset = EngagementType.objects.all().order_by("descriptor")
self.fields["related_caf"].queryset = org.caf_set.all()
self.fields["related_caf"].label = "Related CAFs"
self.helper = FormHelper(self)
diff --git a/ctrack/register/migrations/0003_auto_20201001_1036.py b/ctrack/register/migrations/0003_auto_20201001_1036.py
new file mode 100644
index 0000000..2bf0447
--- /dev/null
+++ b/ctrack/register/migrations/0003_auto_20201001_1036.py
@@ -0,0 +1,39 @@
+# Generated by Django 2.2.12 on 2020-10-01 10:36
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('register', '0002_engagementevent_user'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='engagementevent',
+ name='comments',
+ field=models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True),
+ ),
+ migrations.AlterField(
+ model_name='engagementevent',
+ name='document_link',
+ field=models.URLField(blank=True, help_text='URL only - do not try to drag a file here', max_length=1000, null=True),
+ ),
+ migrations.AlterField(
+ model_name='engagementevent',
+ name='participants',
+ field=models.ManyToManyField(blank=True, null=True, to='organisations.Person'),
+ ),
+ migrations.AlterField(
+ model_name='engagementevent',
+ name='related_caf',
+ field=models.ForeignKey(blank=True, help_text='If the event relates to a CAF, refer to it here.', null=True, on_delete=django.db.models.deletion.CASCADE, to='caf.CAF'),
+ ),
+ migrations.AlterField(
+ model_name='engagementevent',
+ name='short_description',
+ field=models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50),
+ ),
+ ]
diff --git a/ctrack/register/models.py b/ctrack/register/models.py
index 642d69b..f485761 100644
--- a/ctrack/register/models.py
+++ b/ctrack/register/models.py
@@ -56,11 +56,11 @@ class EngagementEvent(models.Model):
short_description = models.CharField(
max_length=50, help_text="Short description of the event. Use Comments field for full detail."
)
- participants = models.ManyToManyField(Person)
+ participants = models.ManyToManyField(Person, blank=True, null=True)
user = models.ForeignKey(get_user_model(), on_delete=models.SET(get_sentinel_user))
date = models.DateTimeField()
- end_date = models.DateTimeField(blank=True, null=True)
- document_link = models.URLField(max_length=1000, blank=True, null=True, help_text="URL only - do not try to drag a file here")
+ end_date = models.DateTimeField(blank=True, null=True, help_text="Should be used for periodic events.")
+ document_link = models.URLField(max_length=1000, blank=True, null=True, help_text="URL only - do not try to drag a file here.")
response_date_requested = models.DateField(blank=True, null=True)
response_received = models.DateField(blank=True, null=True)
related_caf = models.ForeignKey(
diff --git a/ctrack/register/templates/register/engagementevent_form.html b/ctrack/register/templates/register/engagementevent_form.html
index 0103f0d..3aae8c1 100644
--- a/ctrack/register/templates/register/engagementevent_form.html
+++ b/ctrack/register/templates/register/engagementevent_form.html
@@ -26,8 +26,9 @@
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Help on Engagement Events</h5>
- <p class="card-text">An organisation is the parent/operating company. There is probably advice and
- proper definitions for this somewhere. Maybe if you click the link below, it will take you there?</p>
+ <p class="card-text">All key events in the compliance lifecycle need to be registered.</p>
+ <p class="card-text">Events can be <em>singular</em> (such as an email) or <em>periodic</em> (such as a CAF analysis period).</p>
+ <p class="card-text">All events should be registered here.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>