Fix permission group label for Ordering Batches
a minor annoyance, but consistency surely is better...
This commit is contained in:
parent
d145ce5f6d
commit
6af9440ed7
|
@ -360,17 +360,15 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
return response
|
||||
|
||||
@classmethod
|
||||
def defaults(cls, config):
|
||||
def _ordering_defaults(cls, config):
|
||||
route_prefix = cls.get_route_prefix()
|
||||
url_prefix = cls.get_url_prefix()
|
||||
permission_prefix = cls.get_permission_prefix()
|
||||
model_key = cls.get_model_key()
|
||||
model_title = cls.get_model_title()
|
||||
model_title_plural = cls.get_model_title_plural()
|
||||
|
||||
# defaults
|
||||
cls._purchasing_defaults(config)
|
||||
cls._batch_defaults(config)
|
||||
cls._defaults(config)
|
||||
# fix permission group label
|
||||
config.add_tailbone_permission_group(permission_prefix, model_title_plural)
|
||||
|
||||
# download as Excel
|
||||
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),
|
||||
"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):
|
||||
OrderingBatchView.defaults(config)
|
||||
|
|
Loading…
Reference in a new issue