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. decorator.
""" """
if prop and isinstance(prop, property): try:
# Check if the setter function has the attribute set by the @load_state return getattr(prop.fset, "_load_state")
# decorator except AttributeError:
return getattr(prop.fset, "_load_state", False) return False
return False
class StateManager: class StateManager: