Commits

danjac  committed e1f2a7c

fix subscribers

  • Participants
  • Parent commits edfc51e

Comments (0)

Files changed (2)

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

-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

+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
+