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,8 +124,12 @@ def before_render(event):
renderer_globals['messaging_enabled'] = request.rattail_config.getbool( renderer_globals['messaging_enabled'] = request.rattail_config.getbool(
'tailbone', 'messaging.enabled', default=False) 'tailbone', 'messaging.enabled', default=False)
renderer_globals['background_color'] = request.rattail_config.get( # background color may be set per-request, by some apps
'tailbone', 'background_color') 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')
def add_inbox_count(event): def add_inbox_count(event):