aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctrack/caf/templates/caf/applicable_system_create_from_org.html10
-rw-r--r--ctrack/organisations/models.py3
2 files changed, 8 insertions, 5 deletions
diff --git a/ctrack/caf/templates/caf/applicable_system_create_from_org.html b/ctrack/caf/templates/caf/applicable_system_create_from_org.html
index 8a94155..e4d3efa 100644
--- a/ctrack/caf/templates/caf/applicable_system_create_from_org.html
+++ b/ctrack/caf/templates/caf/applicable_system_create_from_org.html
@@ -32,9 +32,13 @@
<div class="card-body">
<h5 class="card-title">Other systems managed by <strong>{{ organisation.name }}:</strong></h5>
<ul class="list-group list-group-flush">
- <li class="list-group-item">baws</li>
- <li class="list-group-item">baws</li>
- <li class="list-group-item">baws</li>
+ {% if organisation.applicable_systems %}
+ {% for s in organisation.applicable_systems %}
+ <li class="list-group-item"><a href="{% url "caf:ass_detail" s.pk %}">{{ s.name }}</a></li>
+ {% endfor %}
+ {% else %}
+ <p>Doesn't have any systems</p>
+ {% endif %}
</ul>
</div>
</div>
diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py
index d7f1194..9eb0a23 100644
--- a/ctrack/organisations/models.py
+++ b/ctrack/organisations/models.py
@@ -153,8 +153,7 @@ class Organisation(models.Model):
return self.person_set.filter(primary_nis_contact=True)
def applicable_systems(self):
- # TODO - we need to do this
- pass
+ return self.applicablesystem_set.all()
class Address(models.Model):