Tweak config handling in case of running tests

This commit is contained in:
Lance Edgar 2017-07-05 13:19:41 -05:00
parent 0b68d56ddb
commit d9569882c9

View file

@ -1808,7 +1808,7 @@ class MasterView(View):
permission='{}.view'.format(permission_prefix))
# version history
if cls.has_versions and rattail_config.versioning_enabled():
if cls.has_versions and rattail_config and rattail_config.versioning_enabled():
config.add_tailbone_permission(permission_prefix, '{}.versions'.format(permission_prefix),
"View version history for {}".format(model_title))
config.add_route('{}.versions'.format(route_prefix), '{}/{{{}}}/versions/'.format(url_prefix, model_key))