fix order create serializer context

This commit is contained in:
behruz-dev
2025-08-20 11:35:29 +05:00
parent c2b2d649bb
commit aa5ff56216
3 changed files with 340 additions and 7 deletions

View File

@@ -64,6 +64,7 @@ class MultipleOrderCreateSerializer(serializers.Serializer):
def create(self, validated_data):
with transaction.atomic():
print(self.context['user'])
resources = validated_data.pop('resources')
common_date = validated_data.get('date')
orders = []
@@ -103,7 +104,7 @@ class OrderListSerializer(serializers.ModelSerializer):
return {
"id": obj.employee.id,
"full_name": obj.employee.full_name,
"phone": obj.employee.phone
"phone_number": obj.employee.phone_number
} if obj.employee else None