mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 03:17:07 +00:00
feat: add location fields to person answer sets
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
Views for displaying or manipulating instances of :class:`Person`.
|
||||
"""
|
||||
|
||||
import typing
|
||||
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.utils import timezone
|
||||
from django.views.generic import CreateView, DetailView, ListView, UpdateView
|
||||
@@ -54,6 +56,14 @@ class ProfileView(permissions.UserIsLinkedPersonMixin, DetailView):
|
||||
# pk was not provided in URL
|
||||
return self.request.user.person
|
||||
|
||||
def get_context_data(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
||||
"""Add current :class:`PersonAnswerSet` to context."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
context['answer_set'] = self.object.current_answers
|
||||
|
||||
return context
|
||||
|
||||
|
||||
class PersonUpdateView(permissions.UserIsLinkedPersonMixin, UpdateView):
|
||||
"""View for updating a :class:`Person` record."""
|
||||
|
||||
Reference in New Issue
Block a user