fix typo in CSRF setting, fix pep8 issues

This commit is contained in:
Thomas Waldmann 2013-11-01 04:22:53 +01:00
parent 7cbacedaf1
commit 60f03b0472
3 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ def DetectIpView(request, secret=None):
ipaddr = request.META['REMOTE_ADDR'] ipaddr = request.META['REMOTE_ADDR']
key = check_ip(ipaddr) key = check_ip(ipaddr)
s[key] = ipaddr s[key] = ipaddr
s[key+'_timestamp'] = now() s[key + '_timestamp'] = now()
logger.debug("detected %s: %s" % (key, ipaddr)) logger.debug("detected %s: %s" % (key, ipaddr))
s.save() s.save()
return HttpResponse(status=204) return HttpResponse(status=204)

View File

@ -247,7 +247,7 @@ def CsrfFailureView(request, reason):
:return: HttpResponse object :return: HttpResponse object
""" """
if reason == "CSRF cookie not set.": if reason == "CSRF cookie not set.":
content ="""\ content = """\
This site needs cookies (for CSRF protection, for keeping your session after login). 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). Please enable cookies in your browser (or otherwise make sure the CSRF cookie can be set).

View File

@ -217,7 +217,7 @@ CSRF_FAILURE_VIEW = 'nsupdate.main.views.CsrfFailureView'
CSRF_COOKIE_NAME = 'csrftoken' CSRF_COOKIE_NAME = 'csrftoken'
CSRF_COOKIE_PATH = '/' CSRF_COOKIE_PATH = '/'
CSRF_COOKIE_SECURE = False CSRF_COOKIE_SECURE = False
SESSION_COOKIE_HTTPONLY = False CSRF_COOKIE_HTTPONLY = False
# Settings for session cookie. # Settings for session cookie.
SESSION_COOKIE_NAME = 'sessionid' SESSION_COOKIE_NAME = 'sessionid'