From 901953d98803344a8b52158f681a230ab1438e21 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 9 Nov 2018 11:13:24 +0100 Subject: [PATCH] Add a Retry-After to 409 responses --- src/pretix/api/exception.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretix/api/exception.py b/src/pretix/api/exception.py index 47869e7f4..5c1f033ba 100644 --- a/src/pretix/api/exception.py +++ b/src/pretix/api/exception.py @@ -10,7 +10,10 @@ def custom_exception_handler(exc, context): if isinstance(exc, LockTimeoutException): response = Response( {'detail': 'The server was too busy to process your request. Please try again.'}, - status=status.HTTP_409_CONFLICT + status=status.HTTP_409_CONFLICT, + headers={ + 'Retry-After': 5 + } ) return response