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
fix: allow for custom states in status field #407
base: main
Are you sure you want to change the base?
Conversation
From celery#366 (comment) Thanks to @cdevacc1 for the idea. I just decided to write up the PR as it only takes a couple of minutes. This should resolve the bug where custom states are not shown at all in the admin panel.
And tests are already failing you can see that |
Yup, forgot to create DB migrations after the change. (unless it was failing for a different reason) |
@auvipy the tests should now pass with the added migration. Can I please request a review? Thanks! |
@@ -51,7 +51,6 @@ class TaskResult(models.Model): | |||
'used with the task')) | |||
status = models.CharField( | |||
max_length=50, default=states.PENDING, | |||
choices=TASK_STATE_CHOICES, |
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 problem with this change I can see is, people using this choice field in existing projects will face breaking change. so we have to find a solution which is backward compatible and existing apps won't break.
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.
@auvipy wouldn't it still let them use the choices? From my understanding removing the choices
parameter just unrestricts the choices from TASK_STATE_CHOICES
. What kind of breaking change are you talking about here?
From #366 (comment)
Thanks to @cdevacc1 for the idea. I just decided to write up the PR as it only takes a couple of minutes. This should resolve the bug where custom states are not shown at all in the admin panel.