From 27930cd8977ab805f2ad3f2bd838bde47e207886 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 17 May 2022 00:41:03 +1000 Subject: [PATCH] PEP style fixes --- InvenTree/InvenTree/exceptions.py | 4 +--- InvenTree/order/serializers.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/InvenTree/InvenTree/exceptions.py b/InvenTree/InvenTree/exceptions.py index 5ba0d80bec..0730442a08 100644 --- a/InvenTree/InvenTree/exceptions.py +++ b/InvenTree/InvenTree/exceptions.py @@ -5,8 +5,6 @@ Custom exception handling for the DRF API # -*- coding: utf-8 -*- from __future__ import unicode_literals -import json - from django.db.utils import OperationalError, ProgrammingError, IntegrityError from django.conf import settings from django.core.exceptions import ValidationError as DjangoValidationError @@ -76,7 +74,7 @@ def exception_handler(exc, context): if response is not None: # For an error response, include status code information response.data['status_code'] = response.status_code - + # Convert errors returned under the label '__all__' to 'non_field_errors' if '__all__' in response.data: response.data['non_field_errors'] = response.data['__all__'] diff --git a/InvenTree/order/serializers.py b/InvenTree/order/serializers.py index 1c261e7a86..ede4c806ef 100644 --- a/InvenTree/order/serializers.py +++ b/InvenTree/order/serializers.py @@ -1295,7 +1295,7 @@ class SalesOrderShipmentAllocationSerializer(serializers.Serializer): quantity=entry.get('quantity'), shipment=shipment, ) - + allocation.full_clean() allocation.save()