Skip to content

'TimeZoneField' has no attribute 'default_choices' #76

@pv8

Description

@pv8

After upgrading django-timezone-field to v4.2, Django (v2.2.24) application is not able to initialize:

    def crontab_schedule_celery_timezone():
        """Return timezone string from Django settings `CELERY_TIMEZONE` variable.

        If is not defined or is not a valid timezone, return `"UTC"` instead.
        """
        try:
            CELERY_TIMEZONE = getattr(
                settings, '%s_TIMEZONE' % current_app.namespace)
        except AttributeError:
            return 'UTC'
        return CELERY_TIMEZONE if CELERY_TIMEZONE in [
>           choice[0].zone for choice in timezone_field.
            TimeZoneField.default_choices
        ] else 'UTC'
E       AttributeError: type object 'TimeZoneField' has no attribute 'default_choices'

../.local/lib/python3.8/site-packages/django_celery_beat/models.py:70: AttributeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions