In the admin interface, we shouldn't be allowed to save a resource which has no `target_url`.**Task**
We should also add validation that when a partner is set to the `.CODES` or `.LINK` access methodIn the admin interface, the `user_instructions` field must contain contentusers shouldn't be allowed to save a partner with the Proxy or Library Bundle access method which has no `target_url` set.
At the moment these links are required for the relevant approval emails to send correctly.In Django, these validations are defined in a model's `clean` function. For Partner objects, that can be found in models.py at https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/resources/models.py#L396.
To solve this task, add a new `if` statement to this function which, if the object has the PROXY or BUNDLE access methods, verifies that it also has `target_url` data. If it doesn't, a `ValidationError` should be raised stating "Proxy and Bundle partners require a target URL".
**Good first task**
This task has been placed in the #good-first-task 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, and include the Phabricator task number in the pull request. Experienced contributors to the project will review your code and either provide feedback or merge it in!