Commit 1e51eaa5 authored by Andreas Valder's avatar Andreas Valder
Browse files

closes #108

parent c323c856
......@@ -76,7 +76,7 @@ def csrf_protect(func):
def decorator(*args, **kwargs):
if '_csrf_token' in request.values:
token = request.values['_csrf_token']
elif '_csrf_token' in request.get_json():
elif request.get_json() and ('_csrf_token' in request.get_json()):
token = request.get_json()['_csrf_token']
else:
token = none
......@@ -468,10 +468,12 @@ def create(table):
if column in tabs[table][3]:
columns.append(column)
values.append(val)
args = request.values
args = request.values.items()
if (request.method == 'POST') and (request.get_json()):
args = request.get_json().items()
print(args)
for column, val in args:
print(column,val)
if (column == 'ref') or (column == '_csrf_token'):
continue
assert column in tabs[table][2]+tabs[table][3]
......@@ -593,5 +595,6 @@ import sorter
if 'ICAL_URL' in config:
import meetings
import l2pauth
import jobs
if 'JOBS_API_KEY' in config:
import jobs
import timetable
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment