aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/caf')
-rw-r--r--ctrack/caf/models.py4
-rw-r--r--ctrack/caf/tests/factories.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index b488962..c290ee3 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -74,4 +74,6 @@ class CAF(models.Model):
verbose_name = "CAF"
def __str__(self):
- return f"CAF | {self.owner}"
+ # Get the organisation and applicable system
+ org = ApplicableSystem.objects.filter(caf=self).first()
+ return f"CAF | {org.name}"
diff --git a/ctrack/caf/tests/factories.py b/ctrack/caf/tests/factories.py
index f2275a4..bc2431e 100644
--- a/ctrack/caf/tests/factories.py
+++ b/ctrack/caf/tests/factories.py
@@ -21,7 +21,7 @@ class CAFFactory(factory.DjangoModelFactory):
model = CAF
-class EssentialServiceFactory(factory.DjangoModelFactory):
+class ApplicableSystemFactory(factory.DjangoModelFactory):
"""Factory for Essential Services."""
name = Faker("text", max_nb_chars=100, ext_word_list=None)