aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/api/common.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-28 10:22:57 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-28 10:22:57 +0100
commita7df1043c338ea106cb745abcec70a3ce4e879a1 (patch)
tree6d97e5ec6888424821f80a9d0070a11a0de4f66f /pyaggr3g470r/views/api/common.py
parentIt is now possible to delete all duplicate articles with one request. (diff)
downloadnewspipe-a7df1043c338ea106cb745abcec70a3ce4e879a1.tar.gz
newspipe-a7df1043c338ea106cb745abcec70a3ce4e879a1.tar.bz2
newspipe-a7df1043c338ea106cb745abcec70a3ce4e879a1.zip
Test of the headers was to strict.
Diffstat (limited to 'pyaggr3g470r/views/api/common.py')
-rw-r--r--pyaggr3g470r/views/api/common.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pyaggr3g470r/views/api/common.py b/pyaggr3g470r/views/api/common.py
index 424df960..405d6b2c 100644
--- a/pyaggr3g470r/views/api/common.py
+++ b/pyaggr3g470r/views/api/common.py
@@ -149,7 +149,7 @@ class PyAggResourceMulti(PyAggAbstractResource):
"""retrieve several objects. filters can be set in the payload on the
different fields of the object, and a limit can be set in there as well
"""
- if 'application/json' != request.headers.get('Content-Type'):
+ if 'application/json' not in request.headers.get('Content-Type'):
raise BadRequest("Content-Type must be application/json")
limit = 10
try:
@@ -163,7 +163,7 @@ class PyAggResourceMulti(PyAggAbstractResource):
def post(self):
"""creating several objects. payload should be a list of dict.
"""
- if 'application/json' != request.headers.get('Content-Type'):
+ if 'application/json' not int request.headers.get('Content-Type'):
raise BadRequest("Content-Type must be application/json")
status = 201
results = []
@@ -184,7 +184,7 @@ class PyAggResourceMulti(PyAggAbstractResource):
[[obj_id1, {attr1: val1, attr2: val2}]
[obj_id2, {attr1: val1, attr2: val2}]]
"""
- if 'application/json' != request.headers.get('Content-Type'):
+ if 'application/json' not in request.headers.get('Content-Type'):
raise BadRequest("Content-Type must be application/json")
status = 200
results = []
@@ -206,7 +206,6 @@ class PyAggResourceMulti(PyAggAbstractResource):
"""will delete several objects,
a list of their ids should be in the payload"""
if 'application/json' not in request.headers.get('Content-Type'):
- print(request.headers.get('Content-Type'))
raise BadRequest("Content-Type must be application/json")
status = 204
results = []
bgstack15