mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1174 from eeintech/fix_category_parameter_url
Fixed category parameter templates settings view
This commit is contained in:
commit
d38d9b21a9
@ -130,7 +130,7 @@ class CategoryParameters(generics.ListAPIView):
|
||||
"""
|
||||
|
||||
try:
|
||||
cat_id = int(self.request.query_params.get('category', None))
|
||||
cat_id = int(self.kwargs.get('pk', None))
|
||||
except TypeError:
|
||||
cat_id = None
|
||||
fetch_parent = str2bool(self.request.query_params.get('fetch_parent', 'true'))
|
||||
@ -910,8 +910,8 @@ part_api_urls = [
|
||||
|
||||
# Base URL for PartCategory API endpoints
|
||||
url(r'^category/', include([
|
||||
url(r'^(?P<pk>\d+)/parameters/?', CategoryParameters.as_view(), name='api-part-category-parameters'),
|
||||
url(r'^(?P<pk>\d+)/?', CategoryDetail.as_view(), name='api-part-category-detail'),
|
||||
url(r'^parameters/?', CategoryParameters.as_view(), name='api-part-category-parameters'),
|
||||
url(r'^$', CategoryList.as_view(), name='api-part-category-list'),
|
||||
])),
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
{% if category %}
|
||||
$("#param-table").inventreeTable({
|
||||
url: "{% url 'api-part-category-parameters' category.pk %}",
|
||||
url: "{% url 'api-part-category-parameters' pk=category.pk %}",
|
||||
queryParams: {
|
||||
ordering: 'name',
|
||||
},
|
||||
@ -58,7 +58,7 @@
|
||||
switchable: false,
|
||||
},
|
||||
{
|
||||
field: 'parameter_template_detail.name',
|
||||
field: 'parameter_template.name',
|
||||
title: '{% trans "Parameter Template" %}',
|
||||
sortable: 'true',
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user