Allow apps to set background color per request

This commit is contained in:
Lance Edgar 2019-03-10 16:36:16 -05:00
parent 9a85bd0edb
commit 5d04de936b

View file

@ -124,6 +124,10 @@ def before_render(event):
renderer_globals['messaging_enabled'] = request.rattail_config.getbool(
'tailbone', 'messaging.enabled', default=False)
# background color may be set per-request, by some apps
if hasattr(request, 'background_color') and request.background_color:
renderer_globals['background_color'] = request.background_color
else: # otherwise we use the one from config
renderer_globals['background_color'] = request.rattail_config.get(
'tailbone', 'background_color')