mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 10:05:39 +00:00
Prevent duplication of unique parts
This commit is contained in:
@ -149,11 +149,9 @@ class PartParameterManager(models.Manager):
|
||||
part_id = kwargs['part']
|
||||
template_id = kwargs['template']
|
||||
|
||||
try:
|
||||
params = self.filter(part=part_id, template=template_id)
|
||||
params = self.filter(part=part_id, template=template_id)
|
||||
if len(params) > 0:
|
||||
return params[0]
|
||||
except:
|
||||
pass
|
||||
|
||||
return super(PartParameterManager, self).create(*args, **kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user