mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
make operators simpler
This commit is contained in:
@ -444,7 +444,7 @@ class Part(MPTTModel):
|
||||
previous = Part.objects.get(pk=self.pk)
|
||||
|
||||
# Image has been changed
|
||||
if previous.image is not None and not self.image == previous.image:
|
||||
if previous.image is not None and self.image != previous.image:
|
||||
|
||||
# Are there any (other) parts which reference the image?
|
||||
n_refs = Part.objects.filter(image=previous.image).exclude(pk=self.pk).count()
|
||||
@ -2895,7 +2895,7 @@ class BomItem(models.Model, DataImportMixin):
|
||||
|
||||
# If the sub_part is 'trackable' then the 'quantity' field must be an integer
|
||||
if self.sub_part.trackable:
|
||||
if not self.quantity == int(self.quantity):
|
||||
if self.quantity != int(self.quantity):
|
||||
raise ValidationError({
|
||||
"quantity": _("Quantity must be integer value for trackable parts")
|
||||
})
|
||||
|
@ -628,7 +628,7 @@ class PartImageDownloadFromURL(AjaxUpdateView):
|
||||
self.response = response
|
||||
|
||||
# Check for valid response code
|
||||
if not response.status_code == 200:
|
||||
if response.status_code != 200:
|
||||
form.add_error('url', _('Invalid response: {code}').format(code=response.status_code))
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user