diff options
author | Martin Thoma <info@martin-thoma.de> | 2020-09-24 18:37:55 +0200 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-10-28 20:20:20 +0100 |
commit | 302caa40e4caab7d95ef7d0a88a90f935039ab09 (patch) | |
tree | 5508daa6533f00834203e2d38e1f02919f513636 /django/utils/cache.py | |
parent | 4eb756793b64cf153be4fbe0411da6e3e4f1279d (diff) | |
download | django-302caa40e4caab7d95ef7d0a88a90f935039ab09.tar.gz |
Made small readability improvements.
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r-- | django/utils/cache.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py index 51dd050452..bb756fe60c 100644 --- a/django/utils/cache.py +++ b/django/utils/cache.py @@ -180,10 +180,13 @@ def get_conditional_response(request, etag=None, last_modified=None, response=No return _precondition_failed(request) # Step 4: Test the If-Modified-Since precondition. - if (not if_none_match_etags and if_modified_since and - not _if_modified_since_passes(last_modified, if_modified_since)): - if request.method in ('GET', 'HEAD'): - return _not_modified(request, response) + if ( + not if_none_match_etags and + if_modified_since and + not _if_modified_since_passes(last_modified, if_modified_since) and + request.method in ('GET', 'HEAD') + ): + return _not_modified(request, response) # Step 5: Test the If-Range precondition (not supported). # Step 6: Return original response since there isn't a conditional response. |