Tweak core view's rattail config init logic, for tests
This commit is contained in:
parent
203f0242fb
commit
936535d625
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue