-
-
Notifications
You must be signed in to change notification settings - Fork 482
Adding on_check_failure to View class
#799
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
Conversation
|
I feel like doing this in The feature could have it's uses though. |
|
I think it would be best to just add the method itself (to allow subclassing and better code organization) but not provide a default behavior (i.e. don't auto-defer on failure). |
|
I don't mind changing it to that if you'd like me to |
|
Is anything going to happen with this for 2.0? |
It's marked as a 2.1 feature and still in draft. |
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.
The code looks good to me. 👍
Summary
I have submitted this pull request before but Danny ended up denying it. I still find this relevant and useful so I am submitting it here again.
This pull request adds the Coro
on_check_failureto theViewclass which is called wheninteraction_checkreturnsFalseand defers the interaction, if not previously responded to, per default (EDIT: it now does not defer the interaction per default anymore).Why this is needed:
interaction_check's purpose is to check if the interaction should go through, not really to handle the case of it not going through. A separate method handling what to do when the check fails seems more clean and useful to deal with that.So thing code which would previously look like
looks now like
Checklist
type: ignorecomments were used, a comment is also left explaining why