2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-21 14:20:54 +00:00

move invenTreePlugin to new class

to enable depreceation
This commit is contained in:
Matthias
2022-01-11 01:41:33 +01:00
parent 52d90cef46
commit 2a7ad93173
6 changed files with 25 additions and 14 deletions

@ -2,14 +2,16 @@
"""
Base Class for InvenTree plugins
"""
import warnings
from django.db.utils import OperationalError, ProgrammingError
from django.utils.text import slugify
class AAInvenTreePlugin():
class InvenTreePluginBase():
"""
Base class for a plugin
DO NOT USE THIS DIRECTLY, USE plugin.IntegrationPluginBase
"""
def __init__(self):
@ -82,3 +84,13 @@ class AAInvenTreePlugin():
return cfg.active
else:
return False
# TODO @matmair remove after InvenTree 0.7.0 release
class InvenTreePlugin(InvenTreePluginBase):
"""
This is here for leagcy reasons and will be removed in the next major release
"""
def __init__(self):
warnings.warn("Using the InvenTreePlugin is depreceated", DeprecationWarning)
super().__init__()