summaryrefslogtreecommitdiffstats
path: root/engagements/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'engagements/models.py')
-rw-r--r--engagements/models.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/engagements/models.py b/engagements/models.py
index 45d8e69..24acabd 100644
--- a/engagements/models.py
+++ b/engagements/models.py
@@ -1,3 +1,5 @@
+from itertools import chain
+
from django.conf import settings
from django.db import models
from django.db.models import Q
@@ -158,7 +160,11 @@ class Engagement(Common):
}
def get_officers(self):
- return [" ".join([x.first_name, x.last_name]) for x in self.officers.all()]
+ officers_from_effort = list(chain.from_iterable([x.officers.all() for x in self.effort.all()]))
+ return [o.fullname() for o in set(officers_from_effort + list(self.officers.all()))]
+ return "toss"
+
+ # return [" ".join([x.first_name, x.last_name]) for x in self.officers.all()]
def total_planning_effort(self):
p_effort = self.engagementeffort_set.all().filter(is_planned=True)