updates has_load_state_decorator logic

This commit is contained in:
Mose Müller 2023-11-09 15:44:18 +01:00
parent eddf3dd2fc
commit 1af4f98a48

View File

@ -50,11 +50,10 @@ def has_load_state_decorator(prop: property):
decorator.
"""
if prop and isinstance(prop, property):
# Check if the setter function has the attribute set by the @load_state
# decorator
return getattr(prop.fset, "_load_state", False)
return False
try:
return getattr(prop.fset, "_load_state")
except AttributeError:
return False
class StateManager: