From f37e55e3b5ae2bf878cf6e922ec85448fd84de14 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 25 Apr 2022 14:05:30 +0200 Subject: [PATCH] add response 201 --- ereuse_devicehub/api/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/api/views.py b/ereuse_devicehub/api/views.py index 2b353445..297bbbba 100644 --- a/ereuse_devicehub/api/views.py +++ b/ereuse_devicehub/api/views.py @@ -69,7 +69,13 @@ class InventoryView(LoginMix, SnapshotMix): db.session.add(snapshot) db.session().final_flush() db.session.commit() - self.response = self.schema.jsonify(snapshot) + self.response = jsonify( + { + 'url': snapshot.device.url, + 'dhid': snapshot.device.devicehub_id, + 'sid': snapshot.sid, + } + ) self.response.status_code = 201 move_json(self.tmp_snapshots, self.path_snapshot, g.user.email) return self.response