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

fix: allow for custom states in status field #407

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ericswpark
Copy link

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.

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.
@auvipy
Copy link
Member

auvipy commented Sep 4, 2023

And tests are already failing you can see that

@ericswpark
Copy link
Author

Yup, forgot to create DB migrations after the change. (unless it was failing for a different reason)

@ericswpark
Copy link
Author

@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,
Copy link
Member

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.

Copy link
Author

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?

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

Successfully merging this pull request may close these issues.

None yet

2 participants