External author cannot update do not email or do not import setting when choosing to leave work in the archivist's care

Description

Steps to reproduce
1. Log in as a user with archivist permissions
2. Post > Import Work
3. Paste in a URL
4. Check "Import for others ONLY with permission"
5. Fill in "Author Name"
6. Fill in "Author Email" with an email address you can access, but which is not the email address for an existing Archive account
7. Check "Post without previewing (STRONGLY recommended if importing for others!)"
8. Press "Import"
9. Log out
10. Follow the "Claim or remove your works here" link in the "Invitation to claim works" email you received
11. Under "Other Options," choose "Leave my works in the care of the archivist"
12. Choose "Do not email me in the future when works are imported with this email address"
13. Press "Update"
14. You'll be redirected to the homepage and see a blue flash notice: "Okay, we'll leave things the way they are! You can use the email link any time if you change your mind."
15. Repeat steps 1-8 using a different URL but the same email address

What should happen
I shouldn't get an email. Also, the flash message in step 14 should include the sentence, "Your preferences have been saved."

What happens instead
I get an email.

Notes
Unlike with other actions, we redirect and return immediately after saving the "leave me work in the care of the archivist" decision:
https://github.com/otwcode/otwarchive/blob/master/app/controllers/external_authors_controller.rb#L67

This means we never get to the code that actually updates the do not email preference. It also means choosing "From now on, do not import works with this email address" while choosing "Leave my works in the care of the archivist" will fail in the same way, so please test this too.

Removing the redirect solves the issue with the preference not updating. However, it means you get the "Your preferences have been saved" notice even if you don't touch the do not email/do not import preferences, which is a little odd. However! That's what currently happens if you choose to orphan or delete the works without touching the do not email/do not import setting, so it's consistent, just... not totally right. We may or may not want to raise an issue for that.

Assignee

Sarken

Reporter

Sarken

Roadmap

Work Importing

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Easy

Required Access Level

Archivist

Milestone

Internal 0.9