2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 11:40:58 +00:00
* bump deps

* use isinstance where possible

* and another bump ;-)

* small fix for isinstance

* fixed wrong comparison

* fixed comparision

* use exact comparision
This commit is contained in:
Matthias Mair
2023-08-06 13:39:15 +02:00
committed by GitHub
parent 54e0e47c6a
commit 879d496e26
11 changed files with 31 additions and 31 deletions

View File

@ -17,13 +17,13 @@ class BaseEnum(enum.IntEnum):
def __eq__(self, obj):
"""Override equality operator to allow comparison with int."""
if type(self) == type(obj):
if type(self) is type(obj):
return super().__eq__(obj)
return self.value == obj
def __ne__(self, obj):
"""Override inequality operator to allow comparison with int."""
if type(self) == type(obj):
if type(self) is type(obj):
return super().__ne__(obj)
return self.value != obj
@ -70,7 +70,7 @@ class StatusCode(BaseEnum):
return False
if callable(value):
return False
if type(value.value) != int:
if not isinstance(value.value, int):
return False
return True