1. Dan Jacob
  2. satchel

Commits

danjac  committed e1f2a7c

fix subscribers

  • Participants
  • Parent commits edfc51e
  • Branches default

Comments (0)

Files changed (2)

File satchel/templates/default_project/+package+/subscribers.py

  • Ignore whitespace
-from pyramid.httpexceptions import HTTPMethodNotAllowed
-
-def check_csrf(event):
-    """
-    Check all incoming HTTP POSTs for CSRF token
-    """
-
-    if event.request.method == "POST":
-        token = event.request.session.get_csrf_token()
-        if token is None or token != event.request.POST.get('csrf'):
-            raise HTTPMethodNotAllowed
-

File satchel/templates/default_project/+package+/subscribers.py_tmpl

View file
  • Ignore whitespace
+from pyramid.httpexceptions import HTTPMethodNotAllowed
+
+
+def check_csrf(event):
+    """
+    Check all incoming HTTP POSTs for CSRF token
+    """
+
+    if event.request.method == "POST":
+        token = event.request.session.get_csrf_token()
+        if token is None or token != event.request.POST.get('csrf'):
+            raise HTTPMethodNotAllowed
+