-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check whether paymentunits have deliverunits set before processing #458
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,9 @@ def is_setup_complete(self): | |
for pu in self.paymentunit_set.all(): | ||
if not (pu.max_total and pu.max_daily): | ||
return False | ||
if not pu.deliver_units.exists(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to add this as validation on the form that sets these up? It probably shouldn't be possible to submit that form (or section of the form) if there are none selected. That way users will also know before forms start to come in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, the form already has this as required, so this shouldn't really happen, I am not sure how it ended up happening. Do you have any idea how this could have occurred? |
||
# Payment unit must have deliver units configured | ||
return False | ||
return True | ||
|
||
@property | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to be more targeted? Occasionally projects add new payment units part way through, and I would be concerned that if they improperly add new ones, this check would prevent the old ones from being processed as well. If we instead just did an error message when we hit this error, that might be safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I am happy to just make a sentry error here instead of hard-fail. Though, per above comment this shouldn't be possible.