Skip to content

Commit

Permalink
TypeError when deleting unused Rocknet rockstor#2814
Browse files Browse the repository at this point in the history
Check for db query _set existence using build-in .exists().
  • Loading branch information
phillxnet committed Mar 26, 2024
1 parent 4d690ef commit 558db69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rockstor/storageadmin/views/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 558db69

Please sign in to comment.