mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 21:15:41 +00:00
Further attempts to fix CI issues
This commit is contained in:
@ -779,7 +779,7 @@ class Part(MPTTModel):
|
||||
|
||||
# Raise an error if an IPN is set, and it is a duplicate
|
||||
if self.IPN and not allow_duplicate_ipn:
|
||||
parts = Part.objects.filter(IPN=self.IPN)
|
||||
parts = Part.objects.filter(IPN__iexact=self.IPN)
|
||||
parts = parts.exclude(pk=self.pk)
|
||||
|
||||
if parts.exists():
|
||||
|
@ -352,10 +352,10 @@ class PartSettingsTest(TestCase):
|
||||
# Any duplicate IPN should raise an error
|
||||
Part.objects.create(name='xyz', revision='1', description='A part', IPN='UNIQUE')
|
||||
|
||||
# Case sensitive, so other variations don't error out:
|
||||
Part.objects.create(name='xyz', revision='2', description='A part', IPN='UNIQUe')
|
||||
Part.objects.create(name='xyz', revision='3', description='A part', IPN='UNIQuE')
|
||||
Part.objects.create(name='xyz', revision='4', description='A part', IPN='UNIqUE')
|
||||
# Case insensitive, so variations on spelling should throw an error
|
||||
for ipn in ['UNiquE', 'uniQuE', 'unique']:
|
||||
with self.assertRaises(ValidationError):
|
||||
Part.objects.create(name='xyz', revision='2', description='A part', IPN=ipn)
|
||||
|
||||
with self.assertRaises(ValidationError):
|
||||
Part.objects.create(name='zyx', description='A part', IPN='UNIQUE')
|
||||
|
Reference in New Issue
Block a user