mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Merge pull request #1124 from eeintech/fix_nocategory_templates_error
Check that category was selected before fetching templates
This commit is contained in:
commit
1d4b826d03
@ -213,6 +213,7 @@ class EditPartForm(HelperForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Part
|
model = Part
|
||||||
fields = [
|
fields = [
|
||||||
|
'confirm_creation',
|
||||||
'category',
|
'category',
|
||||||
'selected_category_templates',
|
'selected_category_templates',
|
||||||
'parent_category_templates',
|
'parent_category_templates',
|
||||||
@ -222,7 +223,6 @@ class EditPartForm(HelperForm):
|
|||||||
'revision',
|
'revision',
|
||||||
'bom_copy',
|
'bom_copy',
|
||||||
'parameters_copy',
|
'parameters_copy',
|
||||||
'confirm_creation',
|
|
||||||
'keywords',
|
'keywords',
|
||||||
'variant_of',
|
'variant_of',
|
||||||
'link',
|
'link',
|
||||||
|
@ -350,7 +350,7 @@ class Part(MPTTModel):
|
|||||||
# Get part category
|
# Get part category
|
||||||
category = self.category
|
category = self.category
|
||||||
|
|
||||||
if add_category_templates:
|
if category and add_category_templates:
|
||||||
# Store templates added to part
|
# Store templates added to part
|
||||||
template_list = []
|
template_list = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user