diff --git a/people/templates/people/organisation/detail.html b/people/templates/people/organisation/detail.html
index 640be30..807f769 100644
--- a/people/templates/people/organisation/detail.html
+++ b/people/templates/people/organisation/detail.html
@@ -24,8 +24,25 @@
+
+
NB: You are able to see the details of this person because you are an admin.
diff --git a/people/templates/people/person/detail_partial.html b/people/templates/people/person/detail_partial.html
index 124213d..15135b7 100644
--- a/people/templates/people/person/detail_partial.html
+++ b/people/templates/people/person/detail_partial.html
@@ -22,9 +22,22 @@
{{ person.name }}
-
New Relationship
-
+
+
+
diff --git a/people/views/organisation.py b/people/views/organisation.py
index c22f3d2..db1b46a 100644
--- a/people/views/organisation.py
+++ b/people/views/organisation.py
@@ -106,10 +106,13 @@ class OrganisationDetailView(LoginRequiredMixin, DetailView):
context_object_name = 'organisation'
template_name = 'people/organisation/detail.html'
- def build_question_answers(self, answer_set: models.OrganisationAnswerSet) -> typing.Dict[str, str]:
+ def build_question_answers(
+ self,
+ answer_set: models.OrganisationAnswerSet) -> typing.Dict[str, str]:
"""Collect answers to dynamic questions and join with commas."""
show_all = self.request.user.is_superuser
- questions = models.OrganisationQuestion.objects.filter(is_hardcoded=False)
+ questions = models.OrganisationQuestion.objects.filter(
+ is_hardcoded=False)
if not show_all:
questions = questions.filter(answer_is_public=True)
@@ -139,6 +142,14 @@ class OrganisationDetailView(LoginRequiredMixin, DetailView):
'lng': getattr(answerset, 'longitude', None),
}]
+ context['relationship'] = None
+ try:
+ context['relationship'] = models.OrganisationRelationship.objects.get(
+ source=self.request.user.person, target=self.object) # yapf: disable
+
+ except models.OrganisationRelationship.DoesNotExist:
+ pass
+
return context
diff --git a/people/views/person.py b/people/views/person.py
index 53e36d6..fe4578a 100644
--- a/people/views/person.py
+++ b/people/views/person.py
@@ -123,6 +123,14 @@ class ProfileView(LoginRequiredMixin, DetailView):
context['question_answers'] = self.build_question_answers(answer_set)
context['map_markers'] = [get_map_data(self.object)]
+ context['relationship'] = None
+ try:
+ context['relationship'] = models.Relationship.objects.get(
+ source=self.request.user.person, target=self.object)
+
+ except models.Relationship.DoesNotExist:
+ pass
+
return context