coderedcorp / coderedcorp/coderedcms
Use correct site when loading settings
- Dominant language
- Python
- Stars
- 765
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
When loading wagtail settings, such as `GoogleApiSettings` or `MailchimpApiSettings` we have a tendency to do these in a place where no `Site` is available and explicitly load the default site. This is a bad practice as it totally breaks the concept of multi-site.
This practice needs to be refactored to get the site from the page or request, and if those are not available, use dependency injection techniques.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating GoogleApiSettings and MailchimpApiSettings usages that explicitly load the default Site, then trace whether each caller has page or request context. Identify callers that need dependency injection; done means settings resolve the relevant site in multisite contexts without falling back to the default site when context is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100