From 1d8a80f5cc41f157403771439f15c9b7d615a43b Mon Sep 17 00:00:00 2001 From: Jeremy Satterfield Date: Tue, 13 Aug 2013 15:31:58 -0500 Subject: don't set X-Throttle-Wait-Second header if throttle wait is None --- rest_framework/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rest_framework/views.py') diff --git a/rest_framework/views.py b/rest_framework/views.py index 37bba7f0..d51233a9 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -269,7 +269,7 @@ class APIView(View): Handle any exception that occurs, by returning an appropriate response, or re-raising the error. """ - if isinstance(exc, exceptions.Throttled): + if isinstance(exc, exceptions.Throttled) and exc.wait is not None: # Throttle wait header self.headers['X-Throttle-Wait-Seconds'] = '%d' % exc.wait -- cgit v1.2.3