From 8f1eee0e89dadcd7ee5f12716c3e861e7634cd28 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 26 Mar 2021 17:57:45 +0100 Subject: [PATCH] fixing url to device --- ereuse_devicehub/resources/tag/view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/tag/view.py b/ereuse_devicehub/resources/tag/view.py index 24d8872a..081383ae 100644 --- a/ereuse_devicehub/resources/tag/view.py +++ b/ereuse_devicehub/resources/tag/view.py @@ -18,7 +18,7 @@ class TagView(View): tag = Tag.query.filter_by(internal_id=internal_id).one() # type: Tag if not tag.device: raise TagNotLinked(tag.id) - return redirect(location=url_for_resource(Device, tag.device.id)) + return redirect(location=url_for_resource(Device, tag.device.devicehub_id)) @auth.Auth.requires_auth def post(self): @@ -84,7 +84,7 @@ class TagDeviceView(View): raise TagNotLinked(tag.id) if not request.authorization: return redirect(location=url_for_resource(Device, tag.device.devicehub_id)) - return app.resources[Device.t].schema.jsonify(tag.device) + return app.resources[Device.t].schema.jsonify(tag.device.devicehub_id) @auth.Auth.requires_auth def one_authorization(self, id):