mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-11 12:46:14 +00:00
Check that category was selected before fetching templates
This commit is contained in:
1 parent
265a29fa1a
commit
d4ac35b9aa
2 files changed
+2
-2
No files matched your search
@@ -215,6 +215,7 @@ class EditPartForm(HelperForm):
|
||||
class Meta:
|
||||
model = Part
|
||||
fields = [
|
||||
'confirm_creation',
|
||||
'category',
|
||||
'selected_category_templates',
|
||||
'parent_category_templates',
|
||||
@@ -224,7 +225,6 @@ class EditPartForm(HelperForm):
|
||||
'revision',
|
||||
'bom_copy',
|
||||
'parameters_copy',
|
||||
'confirm_creation',
|
||||
'keywords',
|
||||
'variant_of',
|
||||
'link',
|
||||
|
||||
@@ -350,7 +350,7 @@ class Part(MPTTModel):
|
||||
# Get part category
|
||||
category = self.category
|
||||
|
||||
if add_category_templates:
|
||||
if category and add_category_templates:
|
||||
# Store templates added to part
|
||||
template_list = []
|
||||
|
||||
|
||||
Reference in new issue
Block a user