API: Allow retry with same idempotency token after error 500

This commit is contained in:
Raphael Michel
2021-04-12 16:30:16 +02:00
parent a93287207b
commit a96023af01
2 changed files with 5 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ class IdempotencyMiddleware:
if created:
resp = self.get_response(request)
with transaction.atomic():
if resp.status_code in (409, 429, 503):
if resp.status_code in (409, 429, 500, 503):
# This is the exception: These calls are *meant* to be retried!
call.delete()
else: