mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 02:55:41 +00:00
Bug fix for part deep-copy
- Don't copy an image if an image doesn't exist
This commit is contained in:
@ -574,10 +574,11 @@ class Part(models.Model):
|
||||
|
||||
# Copy the part image
|
||||
if kwargs.get('image', True):
|
||||
image_file = ContentFile(other.image.read())
|
||||
image_file.name = rename_part_image(self, 'test.png')
|
||||
if other.image:
|
||||
image_file = ContentFile(other.image.read())
|
||||
image_file.name = rename_part_image(self, 'test.png')
|
||||
|
||||
self.image = image_file
|
||||
self.image = image_file
|
||||
|
||||
# Copy the BOM data
|
||||
if kwargs.get('bom', False):
|
||||
|
Reference in New Issue
Block a user