lazy_config leads to circular import under certain conditions

RESOLVED FIXED

Status

Mozilla Developer Network
Code Cleanup
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jezdez, Unassigned)

Tracking

Details

(Whiteboard: [specification][type:bug])

(Reporter)

Description

3 years ago
What did you do?
================
We've had trouble running the Puppet provisioning that would run the update_feeds management command to populate the initial set of feeds.

What happened?
==============
The provisioning fails due to a circular import related to the recent addition of a lazy config helper as part of the demo launch.

What should have happened?
==========================
Not fail.

Is there anything else we should know?
======================================
(Reporter)

Updated

3 years ago
Status: NEW → ASSIGNED
Component: General → Code Cleanup

Comment 1

3 years ago
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/c4c9f4383b804436e08fff19cde4ae56bd2559be
Fix bug 1098194 - Move config_lazy helper to demo models module to prevent circular import.

This happens since the utility requires importing the FIELD list from the constance app, which triggers the population of the Django app cache, which imports other models and voila you have a circular implicite import error.

This would not happen when using modern Django.

https://github.com/mozilla/kuma/commit/3e54d2a91fb738d1c0a2e1ba3fedc43b6d5b4252
Merge pull request #2911 from jezdez/bug1098194

Fix bug 1098194 - Move config_lazy helper to demo models module to prevent circular import.

Updated

3 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.