Fix permission group label for Ordering Batches

a minor annoyance, but consistency surely is better...
This commit is contained in:
Lance Edgar 2018-07-25 16:23:10 -05:00
parent d145ce5f6d
commit 6af9440ed7

View file

@ -360,17 +360,15 @@ class OrderingBatchView(PurchasingBatchView):
return response return response
@classmethod @classmethod
def defaults(cls, config): def _ordering_defaults(cls, config):
route_prefix = cls.get_route_prefix() route_prefix = cls.get_route_prefix()
url_prefix = cls.get_url_prefix() url_prefix = cls.get_url_prefix()
permission_prefix = cls.get_permission_prefix() permission_prefix = cls.get_permission_prefix()
model_key = cls.get_model_key()
model_title = cls.get_model_title() model_title = cls.get_model_title()
model_title_plural = cls.get_model_title_plural()
# defaults # fix permission group label
cls._purchasing_defaults(config) config.add_tailbone_permission_group(permission_prefix, model_title_plural)
cls._batch_defaults(config)
cls._defaults(config)
# download as Excel # download as Excel
config.add_route('{}.download_excel'.format(route_prefix), '{}/{{uuid}}/excel'.format(url_prefix)) config.add_route('{}.download_excel'.format(route_prefix), '{}/{{uuid}}/excel'.format(url_prefix))
@ -379,6 +377,13 @@ class OrderingBatchView(PurchasingBatchView):
config.add_tailbone_permission(permission_prefix, '{}.download_excel'.format(permission_prefix), config.add_tailbone_permission(permission_prefix, '{}.download_excel'.format(permission_prefix),
"Download {} as Excel".format(model_title)) "Download {} as Excel".format(model_title))
@classmethod
def defaults(cls, config):
cls._ordering_defaults(config)
cls._purchasing_defaults(config)
cls._batch_defaults(config)
cls._defaults(config)
def includeme(config): def includeme(config):
OrderingBatchView.defaults(config) OrderingBatchView.defaults(config)