mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-07 15:58:49 +00:00
Fix for registering scheduled tasks (#6815)
- Closes https://github.com/inventree/InvenTree/issues/6793
This commit is contained in:
parent
6ff4d5e035
commit
9576b50152
@ -112,7 +112,7 @@ class ScheduleMixin:
|
|||||||
@property
|
@property
|
||||||
def has_scheduled_tasks(self):
|
def has_scheduled_tasks(self):
|
||||||
"""Are tasks defined for this plugin."""
|
"""Are tasks defined for this plugin."""
|
||||||
return bool(self.scheduled_tasks)
|
return bool(self.get_scheduled_tasks())
|
||||||
|
|
||||||
def validate_scheduled_tasks(self):
|
def validate_scheduled_tasks(self):
|
||||||
"""Check that the provided scheduled tasks are valid."""
|
"""Check that the provided scheduled tasks are valid."""
|
||||||
|
@ -138,7 +138,13 @@ class MixinBase:
|
|||||||
if fnc_name is True:
|
if fnc_name is True:
|
||||||
return 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
|
return False
|
||||||
|
|
||||||
def add_mixin(self, key: str, fnc_enabled=True, cls=None):
|
def add_mixin(self, key: str, fnc_enabled=True, cls=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user