For partners where we're marking as sent automatically (Link, Proxy, Bundle), coordinators should have no need to access the Mark as Sent page, and indeed nothing should link them there. As such, if a coordinator navigates to a partner's Send page we should provide them with a sensible error code.**Task**
As part of this we should also remove the 'this is a proxy/bundle partner' text from that page in this case.The Library Card platform distributes access to a range of publisher partners. In doing so, we directly support 5 different kinds of access methods. For the 'Email' and 'Access codes' methods, coordinators need to access a 'Mark as Sent' page to confirm that the application has been successfully processed. For all other methods, we mark applications as sent automatically (Link, Proxy, Bundle - see T206627). For these partners, coordinators should have no need to access the Mark as Sent page, and indeed nothing should link them there. As such, if a coordinator navigates to a partner's Send page we should provide them with a sensible error code, and don't need to provide any specialised (translated) text there.
This view is defined in [[ https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/applications/views.py#L1034 | SendReadyApplicationsView ]], and fills out [[ https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/applications/templates/applications/send_partner.html | send_partner.html ]].
The steps to completing this task should be:
[] Remove the condition which displays an error message on send_partner.html for non-Email or Codes partners. ([[ https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/applications/templates/applications/send_partner.html#L188 | send_partner.html#L188 ]] and the following line).
[] Override [[ https://docs.djangoproject.com/en/2.2/ref/class-based-views/base/#django.views.generic.base.View.dispatch | DetailView's dispatch function ]] by adding a new function called `dispatch()` which checks if the current partner has an `authorization_method` of `Partner.EMAIL` or `Partner.CODES`.
- If it does, return `super(SendReadyApplicationsView, self).dispatch(request, *args, **kwargs)`.
- If not, raise `Http404` (see an example [here](https://github.com/WikipediaLibrary/TWLight/blob/b7c03d1a39a5f7afa288c2513aa3ac489e2b1883/TWLight/applications/views.py#L420)) with a helpful error message.
[] Add two new tests to `applications/tests.py` in the `MarkSentCase` class. One should test that an 'Email' method partner send page is viewable, and the other should confirm that a 'Proxy' method partner send page returns a 404.
**Good first bug**
This task has been placed in the #good-first-bug category. This means it has been scoped and written in a way that makes it simpler for folks who haven’t contributed to the tool’s development or open source software in the past.
If that’s you, welcome! Please feel free to ask questions here about this specific task or the codebase more generally. We’ll be more than happy to help you and clarify the steps needed to complete the task, whether that’s setting up the repository, implementing the necessary changes, or pushing your changes to Github.
If you have experience contributing to this project or similar ones, please consider leaving this one for someone new, and taking a look at the Open Tasks column of the workboard for another task. Also feel free to help out if you see unanswered questions here!
**How to contribute**
Assign yourself to this task: Click the ‘Add Action’ dropdown menu below and then select Assign / Claim. The box should fill your username in automatically, then click Submit!
To submit your changes, you should [fork the repository and create a new branch](https://blog.scottlowe.org/2015/01/27/using-fork-branch-git-workflow/). After pushing your changes to your Github branch, you can [open a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). Please link your pull request in a comment here when it has been submitted. Experienced contributors to the project will review your code and either provide feedback or merge it in!