remove now unused class ignores
This commit is contained in:
parent
f6e5e907d9
commit
e903d3d3f6
|
|
@ -583,7 +583,7 @@ class Order(
|
|||
|
||||
This method must be implemented by any subclass, as the 'company' field may be named differently for different order types (e.g. supplier vs customer).
|
||||
"""
|
||||
raise NotImplementedError(f'company() method not implemented for {__class__}') # ty:ignore[unresolved-reference]
|
||||
raise NotImplementedError(f'company() method not implemented for {__class__}')
|
||||
|
||||
@property
|
||||
def order_address(self):
|
||||
|
|
@ -608,7 +608,7 @@ class Order(
|
|||
@classmethod
|
||||
def get_status_class(cls):
|
||||
"""Return the enumeration class which represents the 'status' field for this model."""
|
||||
raise NotImplementedError(f'get_status_class() not implemented for {__class__}') # ty:ignore[unresolved-reference]
|
||||
raise NotImplementedError(f'get_status_class() not implemented for {__class__}')
|
||||
|
||||
|
||||
class PurchaseOrder(TotalPriceMixin, Order):
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class ActionMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.ACTION, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.ACTION, True, __class__)
|
||||
|
||||
def action_name(self):
|
||||
"""Action name for this plugin.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class BarcodeMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.BARCODE, 'has_barcode', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.BARCODE, 'has_barcode', __class__)
|
||||
|
||||
@property
|
||||
def has_barcode(self):
|
||||
|
|
@ -105,7 +105,7 @@ class SupplierBarcodeMixin(BarcodeMixin):
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.SUPPLIER_BARCODE, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.SUPPLIER_BARCODE, True, __class__)
|
||||
|
||||
def get_field_value(self, key, backup_value=None):
|
||||
"""Return the value of a barcode field."""
|
||||
|
|
|
|||
|
|
@ -34,4 +34,4 @@ class EventMixin:
|
|||
def __init__(self):
|
||||
"""Register the mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.EVENTS, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.EVENTS, True, __class__)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class IconPackMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.ICON_PACK, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.ICON_PACK, True, __class__)
|
||||
|
||||
@classmethod
|
||||
def _activate_mixin(cls, registry, plugins, *args, **kwargs):
|
||||
|
|
@ -31,5 +31,5 @@ class IconPackMixin:
|
|||
def icon_packs(self) -> list[IconPack]:
|
||||
"""Return a list of custom icon packs."""
|
||||
raise MixinNotImplementedError(
|
||||
f"{__class__} is missing the 'icon_packs' method" # ty:ignore[unresolved-reference]
|
||||
f"{__class__} is missing the 'icon_packs' method"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class APICallMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.API_CALL, 'has_api_call', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.API_CALL, 'has_api_call', __class__)
|
||||
|
||||
@property
|
||||
def has_api_call(self):
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class AppMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.APP, 'has_app', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.APP, 'has_app', __class__)
|
||||
|
||||
@classmethod
|
||||
def _activate_mixin(
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class CurrencyExchangeMixin:
|
|||
def __init__(self):
|
||||
"""Register the mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.CURRENCY_EXCHANGE, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.CURRENCY_EXCHANGE, True, __class__)
|
||||
|
||||
def update_exchange_rates(self, base_currency: str, symbols: list[str]) -> dict:
|
||||
"""Update currency exchange rates.
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class DataExportMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.EXPORTER, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.EXPORTER, True, __class__)
|
||||
|
||||
def supports_export(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class MachineDriverMixin:
|
|||
def __init__(self):
|
||||
"""Initialize the mixin and register it."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.MACHINE, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.MACHINE, True, __class__)
|
||||
|
||||
def get_machine_types(self) -> list[BaseMachineType]:
|
||||
"""Register custom machine types."""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class NavigationMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.NAVIGATION, 'has_navigation', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.NAVIGATION, 'has_navigation', __class__)
|
||||
self.navigation = self.setup_navigation()
|
||||
|
||||
def setup_navigation(self):
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class NotificationMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.NOTIFICATION, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.NOTIFICATION, True, __class__)
|
||||
|
||||
def filter_targets(self, targets: list[User]) -> list[User]:
|
||||
"""Filter notification targets based on the plugin's logic."""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class ReportMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.REPORT, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.REPORT, True, __class__)
|
||||
|
||||
def add_report_context(self, report_instance, model_instance, user, context):
|
||||
"""Add extra context to the provided report instance.
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class ScheduleMixin:
|
|||
|
||||
self.scheduled_tasks = []
|
||||
|
||||
self.add_mixin(PluginMixinEnum.SCHEDULE, 'has_scheduled_tasks', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.SCHEDULE, 'has_scheduled_tasks', __class__)
|
||||
|
||||
@classmethod
|
||||
def _activate_mixin(cls, registry, plugins, *args, **kwargs):
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class SettingsMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.SETTINGS, 'has_settings', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.SETTINGS, 'has_settings', __class__)
|
||||
self.settings = getattr(self, 'SETTINGS', {})
|
||||
self.user_settings = getattr(self, 'USER_SETTINGS', {})
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ class TransitionMixin:
|
|||
"""Initialize the mixin and register it."""
|
||||
super().__init__()
|
||||
self.add_mixin(
|
||||
PluginMixinEnum.STATE_TRANSITION,
|
||||
'has_transition_handlers',
|
||||
__class__, # ty:ignore[unresolved-reference]
|
||||
PluginMixinEnum.STATE_TRANSITION, 'has_transition_handlers', __class__
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class UrlsMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.URLS, 'has_urls', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.URLS, 'has_urls', __class__)
|
||||
self.urls = self.setup_urls()
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ValidationMixin:
|
|||
def __init__(self):
|
||||
"""Register the mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.VALIDATION, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.VALIDATION, True, __class__)
|
||||
|
||||
def raise_error(self, message):
|
||||
"""Raise a ValidationError with the given message."""
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class LabelPrintingMixin:
|
|||
def __init__(self): # pragma: no cover
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.LABELS, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.LABELS, True, __class__)
|
||||
|
||||
BLOCKING_PRINT = True
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class LocateMixin:
|
|||
def __init__(self):
|
||||
"""Register the mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.LOCATE, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.LOCATE, True, __class__)
|
||||
|
||||
def locate_stock_item(self, item_pk):
|
||||
"""Attempt to locate a particular StockItem.
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@ class MailMixin:
|
|||
def __init__(self):
|
||||
"""Register the mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.MAIL, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.MAIL, True, __class__)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class SupplierMixin(SettingsMixin, Generic[PartData]):
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.SUPPLIER, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.SUPPLIER, True, __class__)
|
||||
|
||||
self.SETTINGS['SUPPLIER'] = {
|
||||
'name': 'Supplier',
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class UserInterfaceMixin:
|
|||
def __init__(self):
|
||||
"""Register mixin."""
|
||||
super().__init__()
|
||||
self.add_mixin(PluginMixinEnum.USER_INTERFACE, True, __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin(PluginMixinEnum.USER_INTERFACE, True, __class__)
|
||||
|
||||
def get_ui_features(
|
||||
self, feature_type: FeatureType, context: dict, request: Request, **kwargs
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class BadActorPlugin(InvenTreePlugin):
|
|||
def __init__(self, *args, **kwargs):
|
||||
"""Initialize the plugin."""
|
||||
super().__init__(*args, **kwargs)
|
||||
self.add_mixin('settings', 'has_settings', __class__) # ty:ignore[unresolved-reference]
|
||||
self.add_mixin('settings', 'has_settings', __class__)
|
||||
|
||||
def plugin_slug(self) -> str:
|
||||
"""Return the slug of this plugin."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue