coderedcorp / coderedcorp/coderedcms

Use correct site when loading settings

Open
#341 0 comments 0 reactions 0 assignees View on GitHub
Area: Multisite 🏨 Type: Tech Debt
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.