Skip to content

Commit

Permalink
Fix for registering scheduled tasks (#6815) (#6816)
Browse files Browse the repository at this point in the history
- Closes #6793

(cherry picked from commit 9576b50)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
  • Loading branch information
github-actions[bot] and SchrodingersGat committed Mar 22, 2024
1 parent ac83318 commit 35fc954
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion InvenTree/plugin/base/integration/ScheduleMixin.py
Expand Up @@ -112,7 +112,7 @@ def get_scheduled_tasks(self):
@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."""
Expand Down
8 changes: 7 additions & 1 deletion InvenTree/plugin/plugin.py
Expand Up @@ -138,7 +138,13 @@ def mixin_enabled(self, key):
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):
Expand Down

0 comments on commit 35fc954

Please sign in to comment.