aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-03-04 19:51:14 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-03-04 19:51:14 +0000
commit11834a2580344b90126f3c25b89f18104b3d3ed9 (patch)
treeb4906bfe03de66758e7d878b0210cfed58a8fa6f
parent4c3a0d5808054456f5a90c13d8af62f334e7e031 (diff)
removed owner field from CAF - daring!
-rw-r--r--ctrack/caf/admin.py2
-rw-r--r--ctrack/caf/forms.py2
-rw-r--r--ctrack/caf/migrations/0018_remove_caf_owner.py17
-rw-r--r--ctrack/caf/models.py1
-rw-r--r--ctrack/caf/tests/factories.py1
-rw-r--r--ctrack/organisations/management/commands/populate_db.py1
-rw-r--r--utility/truncate_script.sql2
7 files changed, 20 insertions, 6 deletions
diff --git a/ctrack/caf/admin.py b/ctrack/caf/admin.py
index 5e68ce4..ecdfd58 100644
--- a/ctrack/caf/admin.py
+++ b/ctrack/caf/admin.py
@@ -19,7 +19,7 @@ class CAFAdmin(admin.ModelAdmin):
# but this is a many-to-many relationship, so we need to summarise it somehow
model = CAF
inlines = [ApplicableSystemAdmin]
- list_display = ["owner", "quality_grading", "confidence_grading", "file"]
+ list_display = ["quality_grading", "confidence_grading", "file"]
admin.site.register(CAF, CAFAdmin)
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py
index 8ef9793..fb5e32a 100644
--- a/ctrack/caf/forms.py
+++ b/ctrack/caf/forms.py
@@ -24,7 +24,7 @@ class CAFForm(forms.ModelForm):
class Meta:
model = CAF
- fields = ["owner", "file"]
+ fields = ["file"]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
diff --git a/ctrack/caf/migrations/0018_remove_caf_owner.py b/ctrack/caf/migrations/0018_remove_caf_owner.py
new file mode 100644
index 0000000..02d28c7
--- /dev/null
+++ b/ctrack/caf/migrations/0018_remove_caf_owner.py
@@ -0,0 +1,17 @@
+# Generated by Django 2.2.9 on 2020-03-04 19:47
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('caf', '0017_auto_20200304_1925'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='caf',
+ name='owner',
+ ),
+ ]
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index 0fbfcd8..b488962 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -60,7 +60,6 @@ class ApplicableSystem(models.Model):
class CAF(models.Model):
- owner = models.ForeignKey(Organisation, on_delete=models.CASCADE)
quality_grading = models.ForeignKey(Grading, on_delete=models.CASCADE, blank=True, null=True,
related_name="quality_grading")
confidence_grading = models.ForeignKey(Grading, on_delete=models.CASCADE, blank=True, null=True,
diff --git a/ctrack/caf/tests/factories.py b/ctrack/caf/tests/factories.py
index 31e2403..f2275a4 100644
--- a/ctrack/caf/tests/factories.py
+++ b/ctrack/caf/tests/factories.py
@@ -8,7 +8,6 @@ from ctrack.organisations.tests.factories import OrganisationFactory, PersonFact
class CAFFactory(factory.DjangoModelFactory):
- owner = factory.SubFactory(OrganisationFactory)
quality_grading = factory.SubFactory("ctrack.caf.tests.factories.GradingFactory")
confidence_grading = factory.SubFactory("ctrack.caf.tests.factories.GradingFactory")
file = None
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py
index 7f8ec5d..2800e85 100644
--- a/ctrack/organisations/management/commands/populate_db.py
+++ b/ctrack/organisations/management/commands/populate_db.py
@@ -160,7 +160,6 @@ class Command(BaseCommand):
# Some CAF objects
cafs = [
CAFFactory.create(
- owner=random.choice(orgs),
quality_grading__descriptor=random.choice(q_descriptors),
confidence_grading__descriptor=random.choice(c_descriptors),
triage_review_date=None,
diff --git a/utility/truncate_script.sql b/utility/truncate_script.sql
index 929cd9a..39dd8b4 100644
--- a/utility/truncate_script.sql
+++ b/utility/truncate_script.sql
@@ -10,5 +10,5 @@ TRUNCATE TABLE register_engagementtype RESTART IDENTITY CASCADE;
TRUNCATE TABLE register_engagementevent RESTART IDENTITY CASCADE;
TRUNCATE TABLE caf_grading RESTART IDENTITY CASCADE;
TRUNCATE TABLE caf_caf RESTART IDENTITY CASCADE;
-TRUNCATE TABLE caf_essentialservice RESTART IDENTITY CASCADE;
+TRUNCATE TABLE caf_applicablesystem RESTART IDENTITY CASCADE;
DELETE FROM users_user WHERE username != 'mrlemon';