Uploaded image for project: 'Archive of Our Own'
  1. Archive of Our Own
  2. AO3-4856

Unused code in TagSetNominationsController.request_noncanonical_info (line 129)

    Details

    • Type: Improvement
    • Status: Deployed
    • Priority: Medium
    • Resolution: DeployedToBeta
    • Affects Version/s: 0.9.179
    • Fix Version/s: 0.9.185
    • Milestone:
      Internal 0.9
    • Difficulty:
      Medium
    • Roadmap:
      TagSets
    • Components:
      BackEnd

      Description

      TagSetNominationsController.request_noncanonical_info code is currently:

      def request_noncanonical_info
          if @tag_set_nomination.character_nominations.any? {|tn| !tn.parented && tn.parent_tagname.blank?} ||
            @tag_set_nomination.relationship_nominations.any? {|tn| !tn.parented && tn.parent_tagname.blank?}
            
            flash[:notice] += ts(" Please consider editing to add fandoms to any of your non-canonical tags!")
          end
      end
      

      This noncanonical state can't be triggered through the UI, so the flash message code path is never reached. This noncanonical state is also already prevented via validations at the model-level (e.g. CastNomination.known_fandom). Because this code is unused, it can be removed.

      This came up during AO3-4830 Deployed PR review (https://github.com/otwcode/otwarchive/pull/2728). Creating a separate JIRA issue to keep this code separate.

      Testing Note: This should not change functionality. To test, ensure functionality around creating and updating tag nominations with or without fandom noms is unchanged.

        Attachments

          Activity

            People

            • Assignee:
              cyrilcee cyrilcee
              Reporter:
              cyrilcee cyrilcee
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: