From 10879e61434bea73d6707c916185fc7df62019ee Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 9 Aug 2022 13:19:16 +0200 Subject: [PATCH] fix unbinding --- ereuse_devicehub/inventory/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 8c841a1e..81a4bbfc 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -265,6 +265,12 @@ class UnBindingView(GenericMixin): device = placeholder.binding + if device.is_abstract() != 'Twin': + dhid = device.devicehub_id + next_url = url_for('inventory.device_details', id=dhid) + messages.error('Device "{}" not is a Abstract device!'.format(dhid)) + return flask.redirect(next_url) + self.get_context() if request.method == 'POST':