Changeset 5d04de9 in tailbone


Ignore:
Timestamp:
03/10/19 16:36:16 (6 weeks ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
e18e249
Parents:
9a85bd0
Message:

Allow apps to set background color per request

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tailbone/subscribers.py

    r9a85bd0 r5d04de9  
    125125            'tailbone', 'messaging.enabled', default=False)
    126126
    127         renderer_globals['background_color'] = request.rattail_config.get(
    128             'tailbone', 'background_color')
     127        # background color may be set per-request, by some apps
     128        if hasattr(request, 'background_color') and request.background_color:
     129            renderer_globals['background_color'] = request.background_color
     130        else: # otherwise we use the one from config
     131            renderer_globals['background_color'] = request.rattail_config.get(
     132                'tailbone', 'background_color')
    129133
    130134
Note: See TracChangeset for help on using the changeset viewer.