Repository: TabbycatDebate/tabbycat

Issue:
Convert public submission forms to be by Person
Currently the public adjudicator feedback form is broken due to it taking a `Team` object. When giving everyone a private URL key #690, the public (non-private key) forms were broken by this new object. 

Please see:
https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408713740
https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408717920
https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408718228
For previous discussion on the topic.

Possible solutions are to get `make_feedback_form_class()` to re-accept `Team` objects or replace teams in the list of forms to their constituant speakers.
Convert public submission forms to be by Person
Currently the public adjudicator feedback form is broken due to it taking a `Team` object. When giving everyone a private URL key #690, the public (non-private key) forms were broken by this new object. 

Please see:
https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408713740
https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408717920
https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408718228
For previous discussion on the topic.

Possible solutions are to get `make_feedback_form_class()` to re-accept `Team` objects or replace teams in the list of forms to their constituant speakers.


Discussion:
Hmm, if lots of people use the public submission forms, I don't think we can deprecate them. There's administrative overhead in managing private URLs, and it'll be worth it for some tournaments but not others. It's not a dealbreaker for me if the log consequentially lacks this information, unless there's some functionality wouldn't make any sense without knowing which speaker was behind the submission.
Not the right task @czlee; will write that "issue" to discuss soon. This one is purely about this bug `Adjudicator` or `Team` (this task assumes that we are keeping public submission forms)
For what it's worth, all of these issues seem very closely related to me, and I'd rather have the discussion in a single thread. I agree #684 was the wrong place for it, but I don't really see how we can discuss #707 and #709 separately.
Understood; and it would be okay to bring both discussions here (feel free to close #709). However, I feel that a broken part of a feature should be fixed, regardless of whether there is also discussion on whether to remove/deprecate the whole feature. In that sense, this task could be closed during that discussion, as a resolution to this is not necessarily a resolution for #709, and there are different approaches that could be done for this bug. Anyways, feel free to "merge" both into one; I was just separating the task somewhat arbitrarily.
Okay, so here are four options, which in the long run I believe are mutually exclusive, in that only one of them can be part of the software at any given time:

(1) Make public forms by speaker, in that the URL references their speaker ID, not their team ID
(2) Keep public forms by team, but add a field that has them select which speaker they are
(3) Keep public forms by team, and don't log which speaker submitted it
(4) Deprecate public forms

I don't think (4) is an option for the reason @philipbelesky gave over at https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408713740; they're used quite often, and I can see why people would (as I said above).

(1) would require the submission index to list speakers rather than teams, making the list twice or more as long; (2) would add a field to the submission form. These aren't drastically time-consuming additions, but in my experience most adjudication teams don't care which speaker submitted feedback—and if the tournament is small or informal enough for public submissions to be enabled, they especially wouldn't care. So I think most participants would, rightly, see this as an unnecessary and bothersome step.

That leaves (3). Is it bad if we don't log which speaker submitted it? To answer this—why do we log things? In my mind it's just to allow after-the-fact detective work, say, to allow tab directors to understand what happened when a submission looks wayward (or, in a different context, to allow them to figure out how an adjudicator unexpectedly ended up in a particular room). With private URLs, it's useful information to know whose private URL was used, because then you know either that person submitted it or the private URL was compromised (and knowing whose was compromised might help teammates piece together how that came to be). With public submissions, I'm not really sure what we learn beyond "it was a public submission [from this IP address]", given that there's no concept of a public URL being "compromised".

But more generally, we normally log things on a "best effort" basis. Logging isn't central to an application, so things should never break merely because logging couldn't work. So if the only reason to add functionality that affects user workflow is to keep logs happy, to me that's not a reason at all.
Hmm, if lots of people use the public submission forms, I don't think we can deprecate them. There's administrative overhead in managing private URLs, and it'll be worth it for some tournaments but not others. It's not a dealbreaker for me if the log consequentially lacks this information, unless there's some functionality wouldn't make any sense without knowing which speaker was behind the submission.
Not the right task @czlee; will write that "issue" to discuss soon. This one is purely about this bug `Adjudicator` or `Team` (this task assumes that we are keeping public submission forms)
For what it's worth, all of these issues seem very closely related to me, and I'd rather have the discussion in a single thread. I agree #684 was the wrong place for it, but I don't really see how we can discuss #707 and #709 separately.
Understood; and it would be okay to bring both discussions here (feel free to close #709). However, I feel that a broken part of a feature should be fixed, regardless of whether there is also discussion on whether to remove/deprecate the whole feature. In that sense, this task could be closed during that discussion, as a resolution to this is not necessarily a resolution for #709, and there are different approaches that could be done for this bug. Anyways, feel free to "merge" both into one; I was just separating the task somewhat arbitrarily.
Okay, so here are four options, which in the long run I believe are mutually exclusive, in that only one of them can be part of the software at any given time:

(1) Make public forms by speaker, in that the URL references their speaker ID, not their team ID
(2) Keep public forms by team, but add a field that has them select which speaker they are
(3) Keep public forms by team, and don't log which speaker submitted it
(4) Deprecate public forms

I don't think (4) is an option for the reason @philipbelesky gave over at https://github.com/TabbycatDebate/tabbycat/issues/684#issuecomment-408713740; they're used quite often, and I can see why people would (as I said above).

(1) would require the submission index to list speakers rather than teams, making the list twice or more as long; (2) would add a field to the submission form. These aren't drastically time-consuming additions, but in my experience most adjudication teams don't care which speaker submitted feedback—and if the tournament is small or informal enough for public submissions to be enabled, they especially wouldn't care. So I think most participants would, rightly, see this as an unnecessary and bothersome step.

That leaves (3). Is it bad if we don't log which speaker submitted it? To answer this—why do we log things? In my mind it's just to allow after-the-fact detective work, say, to allow tab directors to understand what happened when a submission looks wayward (or, in a different context, to allow them to figure out how an adjudicator unexpectedly ended up in a particular room). With private URLs, it's useful information to know whose private URL was used, because then you know either that person submitted it or the private URL was compromised (and knowing whose was compromised might help teammates piece together how that came to be). With public submissions, I'm not really sure what we learn beyond "it was a public submission [from this IP address]", given that there's no concept of a public URL being "compromised".

But more generally, we normally log things on a "best effort" basis. Logging isn't central to an application, so things should never break merely because logging couldn't work. So if the only reason to add functionality that affects user workflow is to keep logs happy, to me that's not a reason at all.

Resolving patch:
diff --git a/tabbycat/adjfeedback/forms.py b/tabbycat/adjfeedback/forms.py
--- a/tabbycat/adjfeedback/forms.py
+++ b/tabbycat/adjfeedback/forms.py
@@ -11,7 +11,7 @@
 from adjallocation.models import DebateAdjudicator
 from draw.models import Debate, DebateTeam
 from importer.forms import ImportValidationError
-from participants.models import Adjudicator, Speaker
+from participants.models import Adjudicator, Speaker, Team
 from results.forms import TournamentPasswordField
 from tournaments.models import Round
 from utils.forms import OptionalChoiceField
@@ -222,8 +222,10 @@ def make_feedback_form_class(source, tournament, *args, **kwargs):
         return make_feedback_form_class_for_adj(source, tournament, *args, **kwargs)
     elif isinstance(source, Speaker):
         return make_feedback_form_class_for_team(source.team, tournament, *args, **kwargs)
+    elif isinstance(source, Team):
+        return make_feedback_form_class_for_team(source, tournament, *args, **kwargs)
     else:
-        raise TypeError('source must be Adjudicator or Speaker: %r' % source)
+        raise TypeError('source must be Adjudicator, Speaker, or Team: %r' % source)
 
 
 def make_feedback_form_class_for_adj(source, tournament, submission_fields, confirm_on_submit=False,
diff --git a/tabbycat/adjfeedback/views.py b/tabbycat/adjfeedback/views.py
--- a/tabbycat/adjfeedback/views.py
+++ b/tabbycat/adjfeedback/views.py
@@ -471,6 +471,8 @@ def _populate_source(self):
             self.source_name = self.object.name
         elif isinstance(self.object, Speaker):
             self.source_name = self.get_team_short_name(self.object.team)
+        elif isinstance(self.object, Team):
+            self.source_name = self.get_team_short_name(self.object)
         else:
             logger.error("self.object was neither an Adjudicator nor a Speaker")
             self.source_name = "<ERROR>"


Test patch: