Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KwikKill committed Feb 18, 2024
1 parent f3517cb commit 81ff7b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion insalan/pizza/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ def create(self, validated_data):
"""Create an order"""
price_type = validated_data.pop('type')
pizza = validated_data.pop("pizza")
if "payment_method" not in validated_data:
payment_method = PaymentMethod.CB
else:
payment_method = validated_data["payment_method"]

if validated_data["payment_method"] == PaymentMethod.FR:
if payment_method == PaymentMethod.FR:
price = 0
elif price_type == "staff":
price = TimeSlot.objects.get(id=validated_data["time_slot"].id).staff_price * len(pizza)
Expand Down

0 comments on commit 81ff7b3

Please sign in to comment.