Middleware response fix #23

This commit is contained in:
Nicholas Serra 2017-02-07 22:22:23 -05:00
parent bdb55bb7a7
commit 5c483ac07a
No known key found for this signature in database
GPG key ID: EEDDA4EE375C6D12
2 changed files with 4 additions and 2 deletions

View file

@ -1,3 +1,3 @@
default_app_config = 'tos.apps.TOSConfig'
VERSION = (0, 7, 0)
VERSION = (0, 7, 1)

View file

@ -60,6 +60,8 @@ class UserAgreementMiddleware(object):
cache.set('django:tos:agreed:{}'.format(user_id), user_agreed, version=key_version)
if not user_agreed:
return add_never_cache_headers(HttpResponseRedirect(tos_check_url))
response = HttpResponseRedirect(tos_check_url)
add_never_cache_headers(response)
return response
return None