fix: stabilize profile name migration and parser validation imports
Some checks failed
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Has been cancelled
CI/CD Pipeline / Run Tests (pull_request) Has been cancelled
Some checks failed
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Has been cancelled
CI/CD Pipeline / Run Tests (pull_request) Has been cancelled
This commit is contained in:
@@ -12,8 +12,8 @@ from apps.parsers.models import (
|
||||
IndustrialProductRecord,
|
||||
InspectionRecord,
|
||||
ManufacturerRecord,
|
||||
ParsingSettings,
|
||||
ParserLoadLog,
|
||||
ParsingSettings,
|
||||
ProcurementRecord,
|
||||
Proxy,
|
||||
)
|
||||
|
||||
@@ -11,9 +11,9 @@ from apps.parsers.views import (
|
||||
IndustrialProductViewSet,
|
||||
InspectionViewSet,
|
||||
ManufacturerViewSet,
|
||||
ParsingSettingsView,
|
||||
ParserLoadLogExportView,
|
||||
ParserLoadLogViewSet,
|
||||
ParsingSettingsView,
|
||||
ProcurementViewSet,
|
||||
ProxyViewSet,
|
||||
SourceCardDetailView,
|
||||
|
||||
@@ -16,8 +16,8 @@ from apps.parsers.models import (
|
||||
IndustrialProductRecord,
|
||||
InspectionRecord,
|
||||
ManufacturerRecord,
|
||||
ParsingSettings,
|
||||
ParserLoadLog,
|
||||
ParsingSettings,
|
||||
ProcurementRecord,
|
||||
Proxy,
|
||||
)
|
||||
@@ -28,10 +28,10 @@ from apps.parsers.serializers import (
|
||||
IndustrialCertificateSerializer,
|
||||
IndustrialProductSerializer,
|
||||
InspectionSerializer,
|
||||
ParserLoadLogListSerializer,
|
||||
ParsingSettingsSerializer,
|
||||
ManufacturerSerializer,
|
||||
ParserLoadLogListSerializer,
|
||||
ParserLoadLogSerializer,
|
||||
ParsingSettingsSerializer,
|
||||
ProcurementSerializer,
|
||||
ProxySerializer,
|
||||
SourceCardDetailSerializer,
|
||||
@@ -48,6 +48,7 @@ from django.http import HttpResponse
|
||||
from drf_yasg import openapi
|
||||
from drf_yasg.utils import swagger_auto_schema
|
||||
from rest_framework import status
|
||||
from rest_framework.exceptions import ValidationError
|
||||
from rest_framework.parsers import MultiPartParser
|
||||
from rest_framework.permissions import IsAdminUser, IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
@@ -170,7 +171,9 @@ def _paginate_results(request, rows: list[dict]):
|
||||
page_number = max(1, int(page_raw))
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise ValidationError(
|
||||
{"detail": "Параметры page и page_size должны быть положительными целыми числами."}
|
||||
{
|
||||
"detail": "Параметры page и page_size должны быть положительными целыми числами."
|
||||
}
|
||||
) from exc
|
||||
|
||||
paginator = Paginator(rows, page_size)
|
||||
@@ -1041,7 +1044,10 @@ class ParserLoadLogExportView(APIView):
|
||||
},
|
||||
)
|
||||
def get(self, request):
|
||||
rows = [_serialize_parser_log_row(item) for item in _apply_parser_log_filters(request)]
|
||||
rows = [
|
||||
_serialize_parser_log_row(item)
|
||||
for item in _apply_parser_log_filters(request)
|
||||
]
|
||||
search_term = request.query_params.get("search", "").strip()
|
||||
if search_term:
|
||||
rows = [row for row in rows if _matches_parser_log_search(row, search_term)]
|
||||
|
||||
Reference in New Issue
Block a user