Fix for registering scheduled tasks (#6815) (#6816)

- Closes https://github.com/inventree/InvenTree/issues/6793

(cherry picked from commit 9576b50152)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot]andOliver authored and GitHub committed 2024-03-22 22:15:59 +11:00
1 parent ac83318081
commit 35fc954ff8
2 files changed
+8 -2

No files matched your search

@@ -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."""
+7 -1
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):