From 558db691c46fab65aafe73daee3d8e040a6cac38 Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Tue, 26 Mar 2024 13:16:05 +0000 Subject: [PATCH] TypeError when deleting unused Rocknet #2814 Check for db query _set existence using build-in .exists(). --- src/rockstor/storageadmin/views/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rockstor/storageadmin/views/network.py b/src/rockstor/storageadmin/views/network.py index d314456ff..d497c9bd4 100644 --- a/src/rockstor/storageadmin/views/network.py +++ b/src/rockstor/storageadmin/views/network.py @@ -545,7 +545,7 @@ def _delete_connection(nco): def delete(self, request, id): with self._handle_exception(request): nco = self._nco(request, id) - if nco.bridgeconnection_set.first() > 0: # If docker network + if nco.bridgeconnection_set.exists(): # If docker network brco = nco.bridgeconnection_set.first() # check for running containers and disconnect them first clist = probe_containers(network=brco.docker_name)