PEP style fixes

This commit is contained in:
Oliver Walters 2022-05-17 00:41:03 +10:00
parent 3373bb19f1
commit 27930cd897
2 changed files with 2 additions and 4 deletions

View File

@ -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__']

View File

@ -1295,7 +1295,7 @@ class SalesOrderShipmentAllocationSerializer(serializers.Serializer):
quantity=entry.get('quantity'),
shipment=shipment,
)
allocation.full_clean()
allocation.save()