Skip to content

[bug] Don't raise ValueError: Model is already registered. #20

Description

@fabiocaccamo

Registering the same model from different apps raises:

ValueError: Model is already registered: '<class 'MyModel'>'

but this should not happen, because AnyUrlField could be used by different apps and each app should be allowed to register all the models that it needs, regardless of the models registered by other apps.

Possible solutions:

  1. Don't raise ValueError, just ignore the registration of a model already registered.

  2. When registering a model, check from which app the model is registered and raise a ValueError only if the model has been registered more than once from the same app.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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