mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
fix assertations
This commit is contained in:
parent
2a551e7ab9
commit
d794890264
@ -43,7 +43,7 @@ class MetaBase:
|
|||||||
value = getattr(self, key, None)
|
value = getattr(self, key, None)
|
||||||
|
|
||||||
# The key was not used
|
# The key was not used
|
||||||
if old_key and not value:
|
if old_key and value is None:
|
||||||
value = getattr(self, old_key, None)
|
value = getattr(self, old_key, None)
|
||||||
|
|
||||||
# Sound of a warning if old_key worked
|
# Sound of a warning if old_key worked
|
||||||
@ -51,7 +51,7 @@ class MetaBase:
|
|||||||
warnings.warn(f'Usage of {old_key} was depreciated in 0.7.0 in favour of {key}', DeprecationWarning)
|
warnings.warn(f'Usage of {old_key} was depreciated in 0.7.0 in favour of {key}', DeprecationWarning)
|
||||||
|
|
||||||
# Use __default if still nothing set
|
# Use __default if still nothing set
|
||||||
if not value:
|
if (value is None) and __default:
|
||||||
return __default
|
return __default
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user