-
Notifications
You must be signed in to change notification settings - Fork 431
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 breakage caused by change in django-timezone-field #378
Conversation
With this change, I see two options:
|
Great point @arnau126, I had meant to pin the requirements but forgot in the initial PR |
Another option would be to parse and gate by using the |
@@ -57,7 +57,8 @@ def crontab_schedule_celery_timezone(): | |||
except AttributeError: | |||
return 'UTC' | |||
return CELERY_TIMEZONE if CELERY_TIMEZONE in [ | |||
choice[0].zone for choice in timezone_field.TimeZoneField.CHOICES | |||
choice[0].zone for choice in timezone_field. |
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.
I guess this also need change in model migrations?
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 I don't think any other changes will be needed, the tuples outputted by TimeZoneField.CHOICES
and default_choices
are the same and so the data should be the same.
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.
(venv) ~/D/django-celery-beat ❯❯❯ python3.9 manage.py makemigrations master
No changes detected
hi, Im not quite knowlegable with github, PR and merging. and getting this error:
Is there anything im missing? |
This PR has fixed your error. |
Thank you! |
In mfogel/django-timezone-field@0c6a6ba the
CHOICES
property was removed, it was replaced with two new fieldsdefault_tzs
anddefault_choices
. The latter of the two is the same choices as before and so we just use that now instead.Fixes #377