Stopgap re deletion of donation sites #4208
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partial (just a stop gap) re #4204
Description
This PR prevents the deletion of donation sites if they have donations.
Note that this is only preventing the deletion behind the scenes-- it is strictly a stopgap that we can put in "immediately" if the remainder of the work for #4204 is not yet ready. (I think the remainder of 4204 will be independent of this)
It is just restricting the deletion of the donation site to cases where there are no donations. It leaves the button in place. This is not by any means perfect, but will prevent the most egregious results.
I used restrict_with_error. I considered restrict_with_exception, which would "blow up" iin the bank user's face so they would know something was not right -- whereas this is going to die silently. I chose restrict_with_error because I didn't find any cases of restrict_with_exception in the codebase on search.
This is meant strictly to be a band-aid. Hopefully I will get at least the next step completed for this week as well.
Type of change
How Has This Been Tested?