mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-03-16 20:10:24 +00:00
Middleware response fix #23
This commit is contained in:
parent
bdb55bb7a7
commit
5c483ac07a
2 changed files with 4 additions and 2 deletions
|
|
@ -1,3 +1,3 @@
|
|||
default_app_config = 'tos.apps.TOSConfig'
|
||||
|
||||
VERSION = (0, 7, 0)
|
||||
VERSION = (0, 7, 1)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue