Repository: pretalx/pretalx

Issue:
Allow orga to see talk feedback



Discussion:

Resolving patch:
diff --git a/src/pretalx/orga/urls.py b/src/pretalx/orga/urls.py
--- a/src/pretalx/orga/urls.py
+++ b/src/pretalx/orga/urls.py
@@ -70,6 +70,7 @@
             url('^reviews/(?P<pk>[0-9]+)/$', review.ReviewSubmissionDetail.as_view(), name='reviews.submission.view'),
             url('^reviews/(?P<pk>[0-9]+)/edit$', review.ReviewMySubmission.as_view(), name='reviews.submission.update'),
             url('^reviews/(?P<pk>[0-9]+)/delete$', review.ReviewSubmissionDelete.as_view(), name='reviews.submission.delete'),
+            url('^feedback/$', submission.FeedbackList.as_view(), name='submissions.feedback.list'),
         ])),
 
         url('^speakers$', speaker.SpeakerList.as_view(), name='speakers.list'),
diff --git a/src/pretalx/orga/views/submission.py b/src/pretalx/orga/views/submission.py
--- a/src/pretalx/orga/views/submission.py
+++ b/src/pretalx/orga/views/submission.py
@@ -64,6 +64,11 @@ class SubmissionViewMixin:
     def get_object(self):
         return self.request.event.submissions.filter(code__iexact=self.kwargs.get('code')).first()
 
+    def get_context_data(self, *args, **kwargs):
+        ctx = super().get_context_data(*args, **kwargs)
+        ctx['submission'] = self.get_object()
+        return ctx
+
 
 class SubmissionAccept(SubmissionViewMixin, View):
     def dispatch(self, request, *args, **kwargs):
@@ -178,11 +183,6 @@ class SubmissionContent(ActionFromUrl, SubmissionViewMixin, CreateOrUpdateView):
     form_class = SubmissionForm
     template_name = 'orga/submission/content.html'
 
-    def get_context_data(self, *args, **kwargs):
-        context = super().get_context_data(*args, **kwargs)
-        context['submission'] = self.get_object()
-        return context
-
     def get_success_url(self) -> str:
         self.kwargs.update({'pk': self.object.pk})
         return self.object.orga_urls.base
@@ -240,12 +240,16 @@ def get_queryset(self):
 class SubmissionDelete(SubmissionViewMixin, TemplateView):
     template_name = 'orga/submission/delete.html'
 
-    def get_context_data(self, *args, **kwargs):
-        ctx = super().get_context_data(*args, **kwargs)
-        ctx['submission'] = self.get_object()
-        return ctx
-
     def post(self, request, *args, **kwargs):
         self.get_object().remove(person=request.user)
         messages.success(request, _('The submission has been deleted.'))
         return redirect(request.event.orga_urls.submissions)
+
+
+class FeedbackList(SubmissionViewMixin, ListView):
+    template_name = 'orga/submission/feedback_list.html'
+    context_object_name = 'feedback'
+    paginate_by = 25
+
+    def get_queryset(self):
+        return self.get_object().feedback.all().order_by('pk')
diff --git a/src/pretalx/submission/models/submission.py b/src/pretalx/submission/models/submission.py
--- a/src/pretalx/submission/models/submission.py
+++ b/src/pretalx/submission/models/submission.py
@@ -156,6 +156,7 @@ class orga_urls(Urls):
         reviews = '{self.event.orga_urls.reviews}/{self.code}'
         review_base = '{base}/reviews'
         new_review = '{review_base}/add'
+        feedback = '{base}/feedback'
 
     def assign_code(self, length=6):
         # This omits some character pairs completely because they are hard to read even on screens (1/I and O/0)


Test patch:
diff --git a/src/tests/functional/orga/test_submission.py b/src/tests/functional/orga/test_submission.py
--- a/src/tests/functional/orga/test_submission.py
+++ b/src/tests/functional/orga/test_submission.py
@@ -17,6 +17,13 @@ def test_orga_can_see_single_submission(orga_client, event, submission):
     assert submission.title in response.content.decode()
 
 
+@pytest.mark.django_db
+def test_orga_can_see_single_submission_feedback(orga_client, event, feedback):
+    response = orga_client.get(feedback.talk.orga_urls.feedback, follow=True)
+    assert response.status_code == 200
+    assert feedback.review in response.content.decode()
+
+
 @pytest.mark.django_db
 def test_accept_submission(orga_client, submission):
     assert submission.event.queued_mails.count() == 0