diff --git a/people/models/organisation.py b/people/models/organisation.py index 3f9c76c..62bd70e 100644 --- a/people/models/organisation.py +++ b/people/models/organisation.py @@ -102,6 +102,10 @@ class OrganisationAnswerSet(AnswerSet): #: Answers to :class:`OrganisationQuestion`s question_answers = models.ManyToManyField(OrganisationQuestionChoice) + @property + def location_set(self) -> bool: + return self.latitude and self.longitude + def public_answers(self) -> models.QuerySet: """Get answers to questions which are public.""" return self.question_answers.filter(question__answer_is_public=True) diff --git a/people/models/person.py b/people/models/person.py index 08c76a8..d0f5d41 100644 --- a/people/models/person.py +++ b/people/models/person.py @@ -188,6 +188,10 @@ class PersonAnswerSet(AnswerSet): #: Longitude for displaying location on a map longitude = models.FloatField(blank=True, null=True) + @property + def location_set(self) -> bool: + return self.latitude and self.longitude + def public_answers(self) -> models.QuerySet: """Get answers to questions which are public.""" return self.question_answers.filter(question__answer_is_public=True) diff --git a/people/templates/people/organisation/detail.html b/people/templates/people/organisation/detail.html index 599ec56..d28ff0c 100644 --- a/people/templates/people/organisation/detail.html +++ b/people/templates/people/organisation/detail.html @@ -58,7 +58,10 @@