Skip to content
Snippets Groups Projects

Replace django-dbsettings with django-constance

Merged Nik | Klampfradler requested to merge replace-dbsettings into master
All threads resolved!
Files
9
from django.conf import settings
from colour import web2hex
from constance import config
from sass import SassColor
from aleksis.core.db_settings import theme_settings
def get_colour(html_colour: str) -> SassColor:
rgb = web2hex(html_colour, force_long=True)[1:]
@@ -11,5 +12,5 @@ def get_colour(html_colour: str) -> SassColor:
return SassColor(r, g, b, 255)
def get_theme_setting(setting: str) -> str:
return getattr(theme_settings, setting, "")
def get_setting(setting: str) -> str:
return getattr(config, setting, "") or getattr(settings, setting, "")
Loading