From 2bc4d57ffac001cc1cd7edf7bd73df2ca66fd18f Mon Sep 17 00:00:00 2001 From: Matthias Mair <66015116+matmair@users.noreply.github.com> Date: Mon, 10 Jan 2022 02:49:34 +0100 Subject: [PATCH] remove double code --- .../plugin/builtin/integration/mixins.py | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/InvenTree/plugin/builtin/integration/mixins.py b/InvenTree/plugin/builtin/integration/mixins.py index 14997fd452..c6198ed7a1 100644 --- a/InvenTree/plugin/builtin/integration/mixins.py +++ b/InvenTree/plugin/builtin/integration/mixins.py @@ -301,75 +301,3 @@ class AppMixin: this plugin is always an app with this plugin """ return True - - -class ActionMixin: - """ - Mixin that enables custom actions - """ - ACTION_NAME = "" - - class MixinMeta: - """ - meta options for this mixin - """ - MIXIN_NAME = 'Action' - - def __init__(self): - super().__init__() - self.add_mixin('action', 'has_action', __class__) - - @property - def has_action(self): - """ - Does this plugin have everything needed for an action? - """ - return True - - @property - def action_name(self): - """ - Return the action name for this plugin. - If the ACTION_NAME parameter is empty, - look at the PLUGIN_NAME instead. - """ - if self.ACTION_NAME: - return self.ACTION_NAME - return self.name - - def init(self, user, data=None): - """ - An action plugin takes a user reference, and an optional dataset (dict) - """ - self.user = user - self.data = data - - def perform_action(self): - """ - Override this method to perform the action! - """ - - def get_result(self): - """ - Result of the action? - """ - - # Re-implement this for custom actions - return False - - def get_info(self): - """ - Extra info? Can be a string / dict / etc - """ - return None - - def get_response(self): - """ - Return a response. Default implementation is a simple response - which can be overridden. - """ - return { - "action": self.action_name(), - "result": self.get_result(), - "info": self.get_info(), - }