From 60f03b0472503360caa4582bea0bd584f35127ca Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 1 Nov 2013 04:22:53 +0100 Subject: [PATCH] fix typo in CSRF setting, fix pep8 issues --- nsupdate/api/views.py | 2 +- nsupdate/main/views.py | 2 +- nsupdate/settings.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nsupdate/api/views.py b/nsupdate/api/views.py index 84b3517..9a2449c 100644 --- a/nsupdate/api/views.py +++ b/nsupdate/api/views.py @@ -50,7 +50,7 @@ def DetectIpView(request, secret=None): ipaddr = request.META['REMOTE_ADDR'] key = check_ip(ipaddr) s[key] = ipaddr - s[key+'_timestamp'] = now() + s[key + '_timestamp'] = now() logger.debug("detected %s: %s" % (key, ipaddr)) s.save() return HttpResponse(status=204) diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index c273093..2854343 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -247,7 +247,7 @@ def CsrfFailureView(request, reason): :return: HttpResponse object """ if reason == "CSRF cookie not set.": - content ="""\ + content = """\ This site needs cookies (for CSRF protection, for keeping your session after login). Please enable cookies in your browser (or otherwise make sure the CSRF cookie can be set). diff --git a/nsupdate/settings.py b/nsupdate/settings.py index fd403db..c2e777c 100644 --- a/nsupdate/settings.py +++ b/nsupdate/settings.py @@ -217,14 +217,14 @@ CSRF_FAILURE_VIEW = 'nsupdate.main.views.CsrfFailureView' CSRF_COOKIE_NAME = 'csrftoken' CSRF_COOKIE_PATH = '/' CSRF_COOKIE_SECURE = False -SESSION_COOKIE_HTTPONLY = False +CSRF_COOKIE_HTTPONLY = False # Settings for session cookie. SESSION_COOKIE_NAME = 'sessionid' SESSION_COOKIE_PATH = '/' SESSION_COOKIE_SECURE = False SESSION_COOKIE_HTTPONLY = True -SESSION_COOKIE_AGE = 14 * 24 * 3600 # 2 weeks, in seconds +SESSION_COOKIE_AGE = 14 * 24 * 3600 # 2 weeks, in seconds SESSION_EXPIRE_AT_BROWSER_CLOSE = False