mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-27 10:08:44 +00:00
Merge branch 'master' into block-notes
This commit is contained in:
122 files changed
+29048
-28302
No files matched your search
@@ -23,6 +23,7 @@ from django_q.models import Task
|
||||
from error_report.models import Error
|
||||
from mptt.exceptions import InvalidMove
|
||||
from mptt.models import MPTTModel, TreeForeignKey
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
from stdimage.models import StdImageField
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
@@ -1381,8 +1382,16 @@ class InvenTreeBarcodeMixin(models.Model):
|
||||
|
||||
return generate_barcode(self)
|
||||
|
||||
def format_matched_response(self):
|
||||
def format_matched_response(self, user, **kwargs):
|
||||
"""Format a standard response for a matched barcode."""
|
||||
# Check permission for this object
|
||||
from users.permissions import check_user_permission
|
||||
|
||||
if not check_user_permission(user, self, 'view'):
|
||||
raise PermissionDenied(
|
||||
_('User does not have permission to view this model')
|
||||
)
|
||||
|
||||
data = {'pk': self.pk}
|
||||
|
||||
if hasattr(self, 'get_api_url'):
|
||||
|
||||
@@ -15,10 +15,10 @@ from datetime import timedelta as td
|
||||
from .api_version import INVENTREE_API_TEXT, INVENTREE_API_VERSION
|
||||
|
||||
# InvenTree software version
|
||||
INVENTREE_SW_VERSION = '1.4.0 dev'
|
||||
INVENTREE_SW_VERSION = '1.5.0 dev'
|
||||
|
||||
# Minimum supported Python version
|
||||
MIN_PYTHON_VERSION = (3, 11)
|
||||
MIN_PYTHON_VERSION = (3, 12)
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models import F, OuterRef, Q, Subquery, Sum
|
||||
from django.db.models import DecimalField, F, OuterRef, Q, Subquery, Sum
|
||||
from django.db.models.functions import Coalesce
|
||||
from django.urls import include, path
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@@ -494,9 +494,25 @@ class BuildLineFilter(FilterSet):
|
||||
|
||||
def filter_allocated(self, queryset, name, value):
|
||||
"""Filter by whether each BuildLine is fully allocated."""
|
||||
allocated_subquery = (
|
||||
BuildItem.objects
|
||||
.filter(build_line=OuterRef('pk'))
|
||||
.values('build_line')
|
||||
.annotate(total=Sum('quantity'))
|
||||
.values('total')
|
||||
)
|
||||
|
||||
queryset = queryset.alias(
|
||||
allocated_quantity=Coalesce(
|
||||
Subquery(allocated_subquery), 0, output_field=DecimalField()
|
||||
)
|
||||
)
|
||||
|
||||
if str2bool(value):
|
||||
return queryset.filter(allocated__gte=F('quantity') - F('consumed'))
|
||||
return queryset.filter(allocated__lt=F('quantity') - F('consumed'))
|
||||
return queryset.filter(
|
||||
allocated_quantity__gte=F('quantity') - F('consumed')
|
||||
)
|
||||
return queryset.filter(allocated_quantity__lt=F('quantity') - F('consumed'))
|
||||
|
||||
consumed = rest_filters.BooleanFilter(label=_('Consumed'), method='filter_consumed')
|
||||
|
||||
@@ -528,7 +544,9 @@ class BuildLineFilter(FilterSet):
|
||||
)
|
||||
|
||||
queryset = queryset.alias(
|
||||
allocated_quantity=Coalesce(Subquery(allocated_subquery), 0)
|
||||
allocated_quantity=Coalesce(
|
||||
Subquery(allocated_subquery), 0, output_field=DecimalField()
|
||||
)
|
||||
)
|
||||
|
||||
# A query filter construct to determine the total quantity available for this BuildLine,
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
"""Types for settings."""
|
||||
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from typing import Any, TypedDict
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from typing import NotRequired # pragma: no cover
|
||||
else:
|
||||
|
||||
class NotRequired: # pragma: no cover
|
||||
"""NotRequired type helper is only supported with Python 3.11+."""
|
||||
|
||||
def __class_getitem__(cls, item):
|
||||
"""Return the item."""
|
||||
return item
|
||||
from typing import Any, NotRequired, TypedDict
|
||||
|
||||
|
||||
class SettingsKeyType(TypedDict, total=False):
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -153,7 +153,9 @@ class BarcodeView(CreateAPIView):
|
||||
|
||||
for current_plugin in plugins:
|
||||
try:
|
||||
result = current_plugin.scan(barcode)
|
||||
result = current_plugin.scan(barcode, user=request.user, **kwargs)
|
||||
except PermissionDenied as exc:
|
||||
raise exc
|
||||
except Exception:
|
||||
log_error('BarcodeView.scan_barcode', plugin=current_plugin.slug)
|
||||
continue
|
||||
@@ -282,7 +284,7 @@ class BarcodeAssign(BarcodeView):
|
||||
|
||||
# First check if the provided barcode matches an existing database entry
|
||||
if inventree_barcode_plugin:
|
||||
result = inventree_barcode_plugin.scan(barcode)
|
||||
result = inventree_barcode_plugin.scan(barcode, user=request.user, **kwargs)
|
||||
|
||||
if result is not None:
|
||||
result['error'] = _('Barcode matches existing item')
|
||||
@@ -459,7 +461,9 @@ class BarcodePOAllocate(BarcodeView):
|
||||
manufacturer_part=response.get('manufacturerpart', None),
|
||||
)
|
||||
response['success'] = _('Matched supplier part')
|
||||
response['supplierpart'] = supplier_part.format_matched_response()
|
||||
response['supplierpart'] = supplier_part.format_matched_response(
|
||||
user=request.user
|
||||
)
|
||||
except ValidationError as e:
|
||||
response['error'] = str(e)
|
||||
|
||||
@@ -524,7 +528,7 @@ class BarcodePOReceive(BarcodeView):
|
||||
filter(lambda plugin: plugin.name == 'InvenTreeBarcode', plugins)
|
||||
)
|
||||
|
||||
if result := internal_barcode_plugin.scan(barcode):
|
||||
if result := internal_barcode_plugin.scan(barcode, user=request.user, **kwargs):
|
||||
if 'stockitem' in result:
|
||||
response['error'] = _('Item has already been received')
|
||||
self.log_scan(request, response, False)
|
||||
|
||||
@@ -42,7 +42,7 @@ class BarcodeMixin:
|
||||
"""Does this plugin have everything needed to process a barcode."""
|
||||
return True
|
||||
|
||||
def scan(self, barcode_data):
|
||||
def scan(self, barcode_data: str, user, **kwargs) -> dict | None:
|
||||
"""Scan a barcode against this plugin.
|
||||
|
||||
This method is explicitly called from the /scan/ API endpoint,
|
||||
@@ -261,7 +261,7 @@ class SupplierBarcodeMixin(BarcodeMixin):
|
||||
'extract_barcode_fields must be implemented by each plugin'
|
||||
)
|
||||
|
||||
def scan(self, barcode_data: str) -> dict | None:
|
||||
def scan(self, barcode_data: str, user, **kwargs) -> dict | None:
|
||||
"""Perform a generic 'scan' operation on a supplier barcode.
|
||||
|
||||
The supplier barcode may provide sufficient information to match against
|
||||
@@ -297,7 +297,7 @@ class SupplierBarcodeMixin(BarcodeMixin):
|
||||
for k, v in matches.items():
|
||||
if v and hasattr(v, 'pk'):
|
||||
has_match = True
|
||||
data[k] = v.format_matched_response()
|
||||
data[k] = v.format_matched_response(user=user)
|
||||
|
||||
if not has_match:
|
||||
return None
|
||||
|
||||
@@ -15,6 +15,7 @@ class BarcodeAPITest(InvenTreeAPITestCase):
|
||||
"""Tests for barcode api."""
|
||||
|
||||
fixtures = ['category', 'part', 'location', 'stock']
|
||||
roles = ['stock.view', 'stock_location.view', 'part.view']
|
||||
|
||||
def setUp(self):
|
||||
"""Setup for all tests."""
|
||||
@@ -259,6 +260,7 @@ class SOAllocateTest(InvenTreeAPITestCase):
|
||||
"""Unit tests for the barcode endpoint for allocating items to a sales order."""
|
||||
|
||||
fixtures = ['category', 'company', 'part', 'location', 'stock']
|
||||
roles = ['stock.view']
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
@@ -343,10 +345,14 @@ class SOAllocateTest(InvenTreeAPITestCase):
|
||||
# Test with barcode which points to a *part* instance
|
||||
item.part.assign_barcode(barcode_data='abcde')
|
||||
|
||||
# missing permission for viewing the part - error
|
||||
self.postBarcode('abcde', sales_order=self.sales_order.pk, expected_code=403)
|
||||
|
||||
# Add part.view role and test again
|
||||
self.assignRole('part.view')
|
||||
result = self.postBarcode(
|
||||
'abcde', sales_order=self.sales_order.pk, expected_code=400
|
||||
)
|
||||
|
||||
self.assertIn('does not match an existing stock item', str(result['error']))
|
||||
|
||||
def test_submit(self):
|
||||
|
||||
@@ -48,11 +48,11 @@ class InvenTreeInternalBarcodePlugin(SettingsMixin, BarcodeMixin, InvenTreePlugi
|
||||
},
|
||||
}
|
||||
|
||||
def format_matched_response(self, label, model, instance):
|
||||
def format_matched_response(self, label, model, instance, user, **kwargs):
|
||||
"""Format a response for the scanned data."""
|
||||
return {label: instance.format_matched_response()}
|
||||
return {label: instance.format_matched_response(user=user, **kwargs)}
|
||||
|
||||
def scan(self, barcode_data):
|
||||
def scan(self, barcode_data, user, **kwargs):
|
||||
"""Scan a barcode against this plugin.
|
||||
|
||||
Here we are looking for a dict object which contains a reference to a particular InvenTree database object
|
||||
@@ -79,7 +79,7 @@ class InvenTreeInternalBarcodePlugin(SettingsMixin, BarcodeMixin, InvenTreePlugi
|
||||
|
||||
try:
|
||||
instance = model.objects.get(pk=int(pk))
|
||||
return self.format_matched_response(label, model, instance)
|
||||
return self.format_matched_response(label, model, instance, user=user)
|
||||
except (ValueError, model.DoesNotExist):
|
||||
pass
|
||||
|
||||
@@ -111,7 +111,9 @@ class InvenTreeInternalBarcodePlugin(SettingsMixin, BarcodeMixin, InvenTreePlugi
|
||||
instance = model.objects.get(pk=pk)
|
||||
|
||||
return {
|
||||
**self.format_matched_response(label, model, instance),
|
||||
**self.format_matched_response(
|
||||
label, model, instance, user=user
|
||||
),
|
||||
'success': succcess_message,
|
||||
}
|
||||
except (ValueError, model.DoesNotExist):
|
||||
@@ -129,7 +131,7 @@ class InvenTreeInternalBarcodePlugin(SettingsMixin, BarcodeMixin, InvenTreePlugi
|
||||
|
||||
if instance is not None:
|
||||
return {
|
||||
**self.format_matched_response(label, model, instance),
|
||||
**self.format_matched_response(label, model, instance, user=user),
|
||||
'success': succcess_message,
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
"""Tests for the integrated InvenTreeBarcode barcode plugin."""
|
||||
|
||||
fixtures = ['category', 'part', 'location', 'stock', 'company', 'supplier_part']
|
||||
roles = ['stock.view', 'stock_location.view', 'part.view']
|
||||
|
||||
def setUp(self):
|
||||
"""Set up the test case."""
|
||||
|
||||
@@ -14,6 +14,13 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
||||
"""Tests barcode parsing for all suppliers."""
|
||||
|
||||
SCAN_URL = reverse('api-barcode-scan')
|
||||
roles = [
|
||||
'stock.view',
|
||||
'stock_location.view',
|
||||
'part.view',
|
||||
'company.view',
|
||||
'order.view',
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
@@ -176,6 +183,8 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
||||
class SupplierBarcodePOReceiveTests(InvenTreeAPITestCase):
|
||||
"""Tests barcode scanning to receive a purchase order item."""
|
||||
|
||||
roles = ['stock.view', 'stock_location.view']
|
||||
|
||||
def setUp(self):
|
||||
"""Create supplier part and purchase_order."""
|
||||
super().setUp()
|
||||
|
||||
@@ -108,9 +108,6 @@ def handle_error(error, do_raise: bool = True, do_log: bool = True, log_name: st
|
||||
|
||||
def get_entrypoints():
|
||||
"""Returns list for entrypoints for InvenTree plugins."""
|
||||
# on python before 3.12, we need to use importlib_metadata
|
||||
if sys.version_info < (3, 12):
|
||||
return entry_points().get('inventree_plugins', [])
|
||||
return entry_points(group='inventree_plugins')
|
||||
|
||||
|
||||
@@ -190,13 +187,11 @@ def get_modules(pkg, path=None):
|
||||
continue
|
||||
|
||||
try:
|
||||
if sys.version_info < (3, 12):
|
||||
module = finder.find_module(name).load_module(name)
|
||||
else:
|
||||
spec = finder.find_spec(name)
|
||||
module = module_from_spec(spec)
|
||||
sys.modules[name] = module
|
||||
spec.loader.exec_module(module)
|
||||
spec = finder.find_spec(name, path)
|
||||
module = module_from_spec(spec)
|
||||
sys.modules[name] = module
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
pkg_names = getattr(module, '__all__', None)
|
||||
for k, v in vars(module).items():
|
||||
if not k.startswith('_') and (pkg_names is None or k in pkg_names):
|
||||
|
||||
@@ -117,8 +117,7 @@ def plugins_file_hash():
|
||||
|
||||
try:
|
||||
with pf.open('rb') as f:
|
||||
# Note: Once we support 3.11 as a minimum, we can use hashlib.file_digest
|
||||
return hashlib.sha256(f.read()).hexdigest()
|
||||
return hashlib.file_digest(f, 'sha256').hexdigest()
|
||||
except Exception:
|
||||
log_error('plugins_file_hash', scope='plugins')
|
||||
return None
|
||||
|
||||
@@ -7,6 +7,7 @@ import warnings
|
||||
from datetime import datetime
|
||||
from importlib.metadata import PackageNotFoundError, metadata
|
||||
from pathlib import Path
|
||||
from sysconfig import get_path
|
||||
from typing import Optional
|
||||
|
||||
from django.conf import settings
|
||||
@@ -517,7 +518,6 @@ class InvenTreePlugin(VersionMixin, MixinBase, MetaBase):
|
||||
return InvenTree.helpers.pui_url(f'/settings/admin/plugin/{config.pk}/')
|
||||
return InvenTree.helpers.pui_url('/settings/admin/plugin/')
|
||||
|
||||
# region package info
|
||||
@mark_final
|
||||
def _get_package_commit(self):
|
||||
"""Get last git commit for the plugin."""
|
||||
@@ -527,10 +527,9 @@ class InvenTreePlugin(VersionMixin, MixinBase, MetaBase):
|
||||
@mark_final
|
||||
def is_editable(cls):
|
||||
"""Returns if the current part is editable."""
|
||||
from distutils.sysconfig import get_python_lib
|
||||
|
||||
pkg_name = cls.__name__.split('.')[0]
|
||||
dist_info = list(Path(get_python_lib()).glob(f'{pkg_name}-*.dist-info'))
|
||||
py_lib = get_path('platlib')
|
||||
dist_info = list(Path(py_lib).glob(f'{pkg_name}-*.dist-info'))
|
||||
return bool(len(dist_info) == 1)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -585,15 +585,9 @@ class PluginsRegistry:
|
||||
|
||||
# Gather Modules
|
||||
if parent_path:
|
||||
# On python 3.12 use new loader method
|
||||
if sys.version_info < (3, 12):
|
||||
raw_module = _load_source(
|
||||
plugin_dir, str(parent_obj.joinpath('__init__.py'))
|
||||
)
|
||||
else:
|
||||
raw_module = SourceFileLoader(
|
||||
plugin_dir, str(parent_obj.joinpath('__init__.py'))
|
||||
).load_module()
|
||||
raw_module = SourceFileLoader(
|
||||
plugin_dir, str(parent_obj.joinpath('__init__.py'))
|
||||
).load_module()
|
||||
else:
|
||||
raw_module = importlib.import_module(plugin_dir)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Template tags for rendering various barcodes."""
|
||||
|
||||
from django import template
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
import barcode as python_barcode
|
||||
@@ -70,7 +71,7 @@ def qrcode(data: str, **kwargs) -> str:
|
||||
data = str(data).strip()
|
||||
|
||||
if not data:
|
||||
raise ValueError("No data provided to 'qrcode' template tag")
|
||||
raise ValidationError("qrcode: No data provided to 'qrcode' template tag")
|
||||
|
||||
# Extract other arguments from kwargs
|
||||
fill_color = kwargs.pop('fill_color', 'black')
|
||||
@@ -115,7 +116,7 @@ def barcode(data: str, barcode_class='code128', **kwargs) -> str:
|
||||
data = str(data).strip()
|
||||
|
||||
if not data:
|
||||
raise ValueError("No data provided to 'barcode' template tag")
|
||||
raise ValidationError("barcode: No data provided to 'barcode' template tag")
|
||||
|
||||
constructor = python_barcode.get_barcode_class(barcode_class)
|
||||
|
||||
@@ -134,17 +135,26 @@ def barcode(data: str, barcode_class='code128', **kwargs) -> str:
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def datamatrix(data: str, **kwargs) -> str:
|
||||
def datamatrix(
|
||||
data: str,
|
||||
rectangular: bool = False,
|
||||
fill_color: str = 'black',
|
||||
back_color: str = 'white',
|
||||
scale: float = 1.0,
|
||||
border: int = 1,
|
||||
fmt: str = 'PNG',
|
||||
**kwargs,
|
||||
) -> str:
|
||||
"""Render a DataMatrix barcode.
|
||||
|
||||
Arguments:
|
||||
data: Data to encode
|
||||
|
||||
Keyword Arguments:
|
||||
fill_color (str): Foreground color (default = 'black')
|
||||
back_color (str): Background color (default = 'white')
|
||||
scale (float): Matrix scaling factor (default = 1)
|
||||
border (int): Border width (default = 1)
|
||||
rectangular: Whether to generate a rectangular DataMatrix (default = False)
|
||||
fill_color: Foreground color (default = 'black')
|
||||
back_color: Background color (default = 'white')
|
||||
scale: Scaling factor (default = 1)
|
||||
border: Border width (default = 1)
|
||||
fmt: Generated image format (default = 'PNG')
|
||||
|
||||
Returns:
|
||||
image (str): base64 encoded image data
|
||||
@@ -154,14 +164,11 @@ def datamatrix(data: str, **kwargs) -> str:
|
||||
data = str(data).strip()
|
||||
|
||||
if not data:
|
||||
raise ValueError("No data provided to 'datamatrix' template tag")
|
||||
raise ValidationError(
|
||||
"datamatrix: No data provided to 'datamatrix' template tag"
|
||||
)
|
||||
|
||||
dm = DataMatrix(data)
|
||||
|
||||
fill_color = kwargs.pop('fill_color', 'black')
|
||||
back_color = kwargs.pop('back_color', 'white')
|
||||
|
||||
border = kwargs.pop('border', 1)
|
||||
dm = DataMatrix(data, rect=rectangular)
|
||||
|
||||
try:
|
||||
border = int(border)
|
||||
@@ -180,8 +187,6 @@ def datamatrix(data: str, **kwargs) -> str:
|
||||
except Exception:
|
||||
bg = ImageColor.getcolor('white', 'RGB')
|
||||
|
||||
scale = kwargs.pop('scale', 1)
|
||||
|
||||
height = len(dm.matrix) + 2 * border
|
||||
width = len(dm.matrix[0]) + 2 * border
|
||||
|
||||
@@ -193,7 +198,8 @@ def datamatrix(data: str, **kwargs) -> str:
|
||||
if value:
|
||||
img.putpixel((x + border, y + border), fg)
|
||||
|
||||
if scale != 1:
|
||||
img = img.resize((int(width * scale), int(height * scale)))
|
||||
img = img.resize(
|
||||
(int(width * scale), int(height * scale)), Image.Resampling.NEAREST
|
||||
)
|
||||
|
||||
return image_data(img, fmt='PNG')
|
||||
return image_data(img, fmt=fmt)
|
||||
@@ -440,7 +440,6 @@ class ReportTagTest(PartImageTestMixin, InvenTreeTestCase):
|
||||
]
|
||||
|
||||
for tz, fmt, locale, expected in tests:
|
||||
print(tz, fmt, locale, expected)
|
||||
result = report_tags.format_datetime(
|
||||
time, timezone=tz, fmt=fmt, locale=locale
|
||||
)
|
||||
@@ -857,7 +856,7 @@ class BarcodeTagTest(TestCase):
|
||||
self.assertTrue(barcode.startswith('data:image/bmp;'))
|
||||
|
||||
# Test empty tag
|
||||
with self.assertRaises(ValueError):
|
||||
with self.assertRaises(ValidationError):
|
||||
barcode_tags.barcode('')
|
||||
|
||||
def test_qrcode(self):
|
||||
@@ -877,7 +876,7 @@ class BarcodeTagTest(TestCase):
|
||||
self.assertEqual(len(qrcode), 309720)
|
||||
|
||||
# Test empty tag
|
||||
with self.assertRaises(ValueError):
|
||||
with self.assertRaises(ValidationError):
|
||||
barcode_tags.qrcode('')
|
||||
|
||||
def test_clean_barcode(self):
|
||||
@@ -908,7 +907,7 @@ class BarcodeTagTest(TestCase):
|
||||
)
|
||||
|
||||
# Test empty tag
|
||||
with self.assertRaises(ValueError):
|
||||
with self.assertRaises(ValidationError):
|
||||
barcode_tags.datamatrix('')
|
||||
|
||||
# Failure cases with wrong args
|
||||
|
||||
@@ -594,55 +594,6 @@ sqlparse==0.5.5 \
|
||||
# -c src/backend/requirements.txt
|
||||
# django
|
||||
# django-silk
|
||||
tomli==2.4.1 \
|
||||
--hash=sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853 \
|
||||
--hash=sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe \
|
||||
--hash=sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5 \
|
||||
--hash=sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d \
|
||||
--hash=sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd \
|
||||
--hash=sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26 \
|
||||
--hash=sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54 \
|
||||
--hash=sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6 \
|
||||
--hash=sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c \
|
||||
--hash=sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a \
|
||||
--hash=sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd \
|
||||
--hash=sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f \
|
||||
--hash=sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5 \
|
||||
--hash=sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9 \
|
||||
--hash=sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662 \
|
||||
--hash=sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9 \
|
||||
--hash=sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1 \
|
||||
--hash=sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585 \
|
||||
--hash=sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e \
|
||||
--hash=sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c \
|
||||
--hash=sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41 \
|
||||
--hash=sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f \
|
||||
--hash=sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085 \
|
||||
--hash=sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15 \
|
||||
--hash=sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7 \
|
||||
--hash=sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c \
|
||||
--hash=sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36 \
|
||||
--hash=sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076 \
|
||||
--hash=sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac \
|
||||
--hash=sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8 \
|
||||
--hash=sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232 \
|
||||
--hash=sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece \
|
||||
--hash=sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a \
|
||||
--hash=sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897 \
|
||||
--hash=sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d \
|
||||
--hash=sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4 \
|
||||
--hash=sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917 \
|
||||
--hash=sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396 \
|
||||
--hash=sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a \
|
||||
--hash=sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc \
|
||||
--hash=sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba \
|
||||
--hash=sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f \
|
||||
--hash=sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257 \
|
||||
--hash=sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30 \
|
||||
--hash=sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf \
|
||||
--hash=sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9 \
|
||||
--hash=sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049
|
||||
# via coverage
|
||||
ty==0.0.51 \
|
||||
--hash=sha256:08adbe53fb8bc9e7f00e89bf1d3c875a02cda76d83f109d2e6ab1ff35a7bfa8c \
|
||||
--hash=sha256:25a5b31e6f23fd5dc63ad29087ded09932409e4154e2fe07bbaed015035990bb \
|
||||
|
||||
@@ -8,10 +8,6 @@ asgiref==3.11.1 \
|
||||
# django-allauth
|
||||
# django-cors-headers
|
||||
# django-structlog
|
||||
async-timeout==5.0.1 \
|
||||
--hash=sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c \
|
||||
--hash=sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3
|
||||
# via redis
|
||||
attrs==26.1.0 \
|
||||
--hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \
|
||||
--hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32
|
||||
@@ -1929,7 +1925,6 @@ typing-extensions==4.15.0 \
|
||||
--hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548
|
||||
# via
|
||||
# django-redis
|
||||
# dulwich
|
||||
# flexcache
|
||||
# flexparser
|
||||
# grpcio
|
||||
|
||||
Reference in new issue
Block a user