|
@@ -8,7 +8,6 @@ from tickets.serializer import TaskSerializer
|
|
|
from rest_framework.utils import model_meta
|
|
|
import pprint
|
|
|
from django.db import connection
|
|
|
-from webservice_running.exceptions import *
|
|
|
|
|
|
|
|
|
class OrderNotDefined(Exception):
|
|
@@ -64,9 +63,11 @@ class OrdersLocalSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
|
def update(self, instance, validated_data):
|
|
|
- # pprint.pprint(connection.queries)
|
|
|
+ """
|
|
|
+ Normally order_synced is not null, but in testing it is null=True, so it can produce exceptions
|
|
|
+ """
|
|
|
|
|
|
- order_instance = instance.order_synced #if "order_synced" not in validated_data else validated_data["order_synced"]
|
|
|
+ order_instance = instance.order_synced
|
|
|
if not order_instance:
|
|
|
raise OrderNotDefined()
|
|
|
ticket_instance = instance.order_synced.ticket
|