mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-29 01:42:37 +02:00
API: set the mimetype on the response
This commit is contained in:
parent
e13ceaf351
commit
8528526f0b
2 changed files with 4 additions and 1 deletions
|
@ -64,6 +64,8 @@ class MemberHandler(object):
|
||||||
def delete(self, project, member_id):
|
def delete(self, project, member_id):
|
||||||
if project.remove_member(member_id):
|
if project.remove_member(member_id):
|
||||||
return Response('OK', status=200)
|
return Response('OK', status=200)
|
||||||
|
else:
|
||||||
|
return Response('Not Found', status=404)
|
||||||
|
|
||||||
|
|
||||||
class BillHandler(object):
|
class BillHandler(object):
|
||||||
|
|
|
@ -133,7 +133,8 @@ def serialize(func):
|
||||||
return data
|
return data
|
||||||
else:
|
else:
|
||||||
# serialize it
|
# serialize it
|
||||||
return SERIALIZERS.get(mime, "text/json").encode(data)
|
return werkzeug.Response(SERIALIZERS[mime].encode(data),
|
||||||
|
status=200, mimetype=mime)
|
||||||
|
|
||||||
return wrapped
|
return wrapped
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue