[Pulp-dev] FYI: Use get_model() in migrations. Maybe audit your plugin too?

Brian Bouterse bmbouter at redhat.com
Wed Feb 3 16:01:54 UTC 2021


We ran into an issue <https://pulp.plan.io/issues/8203> (I originally
created </facepalm>) where migrations were importing a Model like:

from my_plugin.apps.models import MyModel

Instead Django wants us to use `apps.get_model('app_name', 'MyModel')`
which reconstructs a historical model from the DB.

I opened a PR to fix in pulpcore
<https://github.com/pulp/pulpcore/pull/1111>, and audited pulp_file and
pulp_ansible. Consider auditing your plugins too?

Cheers,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20210203/eb535e3b/attachment.htm>


More information about the Pulp-dev mailing list