Tweak core view's rattail config init logic, for tests

This commit is contained in:
Lance Edgar 2016-11-19 18:56:09 -06:00
parent 203f0242fb
commit 936535d625

View file

@ -41,14 +41,16 @@ class View(object):
def __init__(self, request):
self.request = request
self.enum = self.rattail_config.get_enum()
config = self.rattail_config
if config:
self.enum = config.get_enum()
@property
def rattail_config(self):
"""
Reference to the effective Rattail config object.
"""
return self.request.rattail_config
return getattr(self.request, 'rattail_config', None)
def late_login_user(self):
"""