Skip to content

AppRegistryNotReady raised if us_states imported in app config ready() method #187

Open
@rush340

Description

@rush340

If the us_states module is imported within an AppConfig's ready() method, then an AppRegistryNotReady exception will be raised. The sorting for STATE_CHOICES and USPS_CHOICES is forcing resolution of the lazily translated state names at import time, but i18n isn't available yet.

In our case we're importing a view class in our ready() method to read a property off of it. Our views module imports something from models where we have a model that's using the USStateField which causes the import of us_states.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions