From a7ef560ee348cfd2adff65d321fbfa657f7e1c8f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 24 May 2022 01:20:59 +0200 Subject: [PATCH] remove dead code (#3054) no references are found in the code --- InvenTree/label/models.py | 47 --------------------------------------- 1 file changed, 47 deletions(-) diff --git a/InvenTree/label/models.py b/InvenTree/label/models.py index 07819806bf..4da42d73a9 100644 --- a/InvenTree/label/models.py +++ b/InvenTree/label/models.py @@ -8,7 +8,6 @@ import os import sys from django.conf import settings -from django.core.exceptions import FieldError, ValidationError from django.core.validators import FileExtensionValidator, MinValueValidator from django.db import models from django.template import Context, Template @@ -255,22 +254,6 @@ class StockItemLabel(LabelTemplate): ] ) - def matches_stock_item(self, item): - """ - Test if this label template matches a given StockItem object - """ - - try: - filters = validateFilterString(self.filters) - items = stock.models.StockItem.objects.filter(**filters) - except (ValidationError, FieldError): - # If an error exists with the "filters" field, return False - return False - - items = items.filter(pk=item.pk) - - return items.exists() - def get_context_data(self, request): """ Generate context data for each provided StockItem @@ -314,21 +297,6 @@ class StockLocationLabel(LabelTemplate): validate_stock_location_filters] ) - def matches_stock_location(self, location): - """ - Test if this label template matches a given StockLocation object - """ - - try: - filters = validateFilterString(self.filters) - locs = stock.models.StockLocation.objects.filter(**filters) - except (ValidationError, FieldError): - return False - - locs = locs.filter(pk=location.pk) - - return locs.exists() - def get_context_data(self, request): """ Generate context data for each provided StockLocation @@ -362,21 +330,6 @@ class PartLabel(LabelTemplate): ] ) - def matches_part(self, part): - """ - Test if this label template matches a given Part object - """ - - try: - filters = validateFilterString(self.filters) - parts = part.models.Part.objects.filter(**filters) - except (ValidationError, FieldError): - return False - - parts = parts.filter(pk=part.pk) - - return parts.exists() - def get_context_data(self, request): """ Generate context data for each provided Part object