Skip to content

Commit

Permalink
fix create subscription endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Aug 21, 2024
1 parent 048e704 commit 97103c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion breathecode/payments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,12 @@ def post(self, request, plan_slug: str, academy_id: int):

request.data["plans"] = [plan_slug]

invoice, coupons = actions.validate_and_create_subscriptions(request, request.user, proof, academy_id, lang)
try:
invoice, coupons = actions.validate_and_create_subscriptions(request, request.user, proof, academy_id, lang)

except Exception as e:
proof.delete()
raise e

s1 = GetInvoiceSerializer(invoice, many=False)
s2 = GetCouponSerializer(coupons, many=True)
Expand Down

0 comments on commit 97103c9

Please sign in to comment.