Fix for registering scheduled tasks (#6815)

- Closes https://github.com/inventree/InvenTree/issues/6793
This commit is contained in:
Oliver 2024-03-22 21:33:52 +11:00 committed by GitHub
parent 6ff4d5e035
commit 9576b50152
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -112,7 +112,7 @@ class ScheduleMixin:
@property
def has_scheduled_tasks(self):
"""Are tasks defined for this plugin."""
return bool(self.scheduled_tasks)
return bool(self.get_scheduled_tasks())
def validate_scheduled_tasks(self):
"""Check that the provided scheduled tasks are valid."""

View File

@ -138,7 +138,13 @@ class MixinBase:
if fnc_name is True:
return True
return getattr(self, fnc_name, True)
attr = getattr(self, fnc_name, True)
if callable(attr):
return attr()
else:
return attr
return False
def add_mixin(self, key: str, fnc_enabled=True, cls=None):