Skip to content
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

Improvement: Use on_progress and on_date_change as validity checks #425

Open
KebabRonin opened this issue Sep 12, 2024 · 0 comments
Open

Comments

@KebabRonin
Copy link

Currently, the on_progress and on_date_change events are triggered after a task has been updated. As such, the secod/third parameters, presumably containing the new values, are redundant (they are the same as their respective fields in the task object).

A fix for this would be to trigger the event before the update, or to create a new event that gets triggered before as opposed to after a change.

Additionally, the callbacks could return a true or false depending on if the change should continue. On a false, the task is reverted back to its state before starting the change.

Example:

If I want to implement a validation check for the new date (like not allowing a task to start on certain days, or not allowing any progress changes), I can't use the old values as part of that check or to revert the bar to it's previous state on a failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant