aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-10-02 16:47:25 +0100
committerMatthew Lemon <matt@matthewlemon.com>2020-10-02 16:47:48 +0100
commit4a92042e7d1ebbca2537e49166cea1aa0a60aac6 (patch)
tree520f2be6c9e17a5d2e24278284e926be901fa97c /ctrack
parent11b4886e07aafe9f7d0412adc6d7556f78ea1dc2 (diff)
fixed broken populate script
Diffstat (limited to 'ctrack')
-rw-r--r--ctrack/core/utils.py41
-rw-r--r--ctrack/register/migrations/0004_auto_20201002_1516.py28
-rw-r--r--ctrack/register/migrations/0005_auto_20201002_1536.py18
-rw-r--r--ctrack/register/models.py4
4 files changed, 68 insertions, 23 deletions
diff --git a/ctrack/core/utils.py b/ctrack/core/utils.py
index 3c97366..eed8e0b 100644
--- a/ctrack/core/utils.py
+++ b/ctrack/core/utils.py
@@ -210,17 +210,16 @@ def populate_db(**kwargs):
EngagementTypeFactory(
descriptor="Video Conference", enforcement_instrument=False
)
- EngagementTypeFactory(descriptor="Email", enforcement_instrument=False)
- EngagementTypeFactory(descriptor="CAF - Initial Review", enforcement_instrument=False)
- EngagementTypeFactory(descriptor="CAF - Peer Review")
- EngagementTypeFactory(descriptor="CAF - Validation")
- EngagementTypeFactory(descriptor="CAF - Sent to Rosa")
- EngagementTypeFactory(descriptor="CAF - Received from OES (USB)")
- EngagementTypeFactory(descriptor="Audit - Onsite")
- EngagementTypeFactory(descriptor="Audit - Offsite")
- EngagementTypeFactory(descriptor="Inspection - Onsite")
- EngagementTypeFactory(descriptor="Inspection - Offsite")
-
+ EngagementTypeFactory.create(descriptor="Email", enforcement_instrument=False)
+ EngagementTypeFactory.create(descriptor="CAF - Initial Review", enforcement_instrument=False)
+ EngagementTypeFactory.create(descriptor="CAF - Peer Review")
+ EngagementTypeFactory.create(descriptor="CAF - Validation")
+ EngagementTypeFactory.create(descriptor="CAF - Sent to Rosa")
+ EngagementTypeFactory.create(descriptor="CAF - Received from OES (USB)")
+ EngagementTypeFactory.create(descriptor="Audit - Onsite")
+ EngagementTypeFactory.create(descriptor="Audit - Offsite")
+ EngagementTypeFactory.create(descriptor="Inspection - Onsite")
+ EngagementTypeFactory.create(descriptor="Inspection - Offsite")
EngagementEventFactory.create(type=etf1, user=user, participants=[p1, p2])
EngagementEventFactory.create(type=etf2, user=user, participants=[p3])
@@ -247,7 +246,7 @@ def populate_db(**kwargs):
# Get a random CAF
_caf = CAF.objects.get(pk=1) # we should have one by now
EngagementEventFactory.create(
- type=etf3, user=user, participants=[inspectors[1], p2], related_caf=_caf
+ type=etf2, user=user, participants=[inspectors[1], p2], related_caf=_caf
)
# We want to simulate 4 CAF Objectives
@@ -392,7 +391,7 @@ def populate_db(**kwargs):
designation="A1.b",
name="Roles and Responsibilities",
description="Your elders and betters are impressed and they continue to make money after your project "
- "implementation.",
+ "implementation.",
principle_id=p_a1.id,
order_id=2,
),
@@ -400,7 +399,7 @@ def populate_db(**kwargs):
designation="A1.c",
name="Decision-making",
description="If you are forced to participate in the Crystal Maze, you'll choose the coorect path across "
- "the Gordian runway.",
+ "the Gordian runway.",
principle_id=p_a1.id,
order_id=3,
),
@@ -457,7 +456,7 @@ def populate_db(**kwargs):
designation="B2.b",
name="Device Management",
description="Your devices, and their safe and sustainable use, is crucuial to the longevity of your "
- "company.",
+ "company.",
principle_id=p_b2.id,
order_id=2,
),
@@ -465,7 +464,7 @@ def populate_db(**kwargs):
designation="B2.c",
name="Privileged User Mangement",
description="You ensure that even the most privileged members of your senior management are under the "
- "impression that they exude inequality, in all instances.",
+ "impression that they exude inequality, in all instances.",
principle_id=p_b2.id,
order_id=3,
),
@@ -508,7 +507,7 @@ def populate_db(**kwargs):
designation="B4.a",
name="Secure by Design",
description="You have designed your systems to be secure and you're sure no one is going to hack "
- "into them.",
+ "into them.",
principle_id=p_b4.id,
order_id=1,
),
@@ -516,7 +515,7 @@ def populate_db(**kwargs):
designation="B4.b",
name="Secure Configuration",
description="When you are able to configure your systems and software well, you can say you have Secure "
- "Configuration. Only then, mind.",
+ "Configuration. Only then, mind.",
principle_id=p_b4.id,
order_id=2,
),
@@ -566,7 +565,7 @@ def populate_db(**kwargs):
designation="B6.b",
name="Cyber Security Training",
description="By the way, when youre staff are able to write C code, your company understands buffer "
- "overflows.",
+ "overflows.",
principle_id=p_b6.id,
order_id=2,
),
@@ -595,7 +594,7 @@ def populate_db(**kwargs):
designation="C1.d",
name="Identifying Security Incidents",
description="You are wary of all the possible things that could go wrong and you have a plan to deal. Well "
- "done.",
+ "done.",
principle_id=p_c1.id,
order_id=4,
),
@@ -617,7 +616,7 @@ def populate_db(**kwargs):
designation="C2.b",
name="Proactive Attack Discovery",
description="When you go out looking for the bad stuff, you usefully find it - "
- "and you know this in spades.",
+ "and you know this in spades.",
principle_id=p_c2.id,
order_id=2,
),
diff --git a/ctrack/register/migrations/0004_auto_20201002_1516.py b/ctrack/register/migrations/0004_auto_20201002_1516.py
new file mode 100644
index 0000000..206cf9b
--- /dev/null
+++ b/ctrack/register/migrations/0004_auto_20201002_1516.py
@@ -0,0 +1,28 @@
+# Generated by Django 2.2.12 on 2020-10-02 15:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('register', '0003_auto_20201001_1036'),
+ ]
+
+ operations = [
+ 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='end_date',
+ field=models.DateTimeField(blank=True, help_text='Should be used for periodic events.', null=True),
+ ),
+ migrations.AlterField(
+ model_name='engagementtype',
+ name='descriptor',
+ field=models.CharField(max_length=100),
+ ),
+ ]
diff --git a/ctrack/register/migrations/0005_auto_20201002_1536.py b/ctrack/register/migrations/0005_auto_20201002_1536.py
new file mode 100644
index 0000000..2fce0b1
--- /dev/null
+++ b/ctrack/register/migrations/0005_auto_20201002_1536.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.12 on 2020-10-02 15:36
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('register', '0004_auto_20201002_1516'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='engagementevent',
+ name='participants',
+ field=models.ManyToManyField(blank=True, to='organisations.Person'),
+ ),
+ ]
diff --git a/ctrack/register/models.py b/ctrack/register/models.py
index a435002..8c35ef9 100644
--- a/ctrack/register/models.py
+++ b/ctrack/register/models.py
@@ -29,7 +29,7 @@ class EngagementType(models.Model):
Also official instruments such as designation letters, Information Notices, etc.
"""
- descriptor = models.CharField(max_length=50, blank=False)
+ descriptor = models.CharField(max_length=100, blank=False)
enforcement_instrument = models.BooleanField(default=False)
regulation_reference = models.CharField(max_length=100, blank=True, null=True)
comments = models.TextField(max_length=1000, blank=True, null=True)
@@ -55,7 +55,7 @@ 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, blank=True, null=True)
+ participants = models.ManyToManyField(Person, blank=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, help_text="Should be used for periodic events.")