Commit d303d26a authored by Dionysis Grigoropoulos's avatar Dionysis Grigoropoulos
Browse files

cyclades: Fix a bug in subnet creation

* Do not allow subnet creation on deleted networks
parent afb6ddeb
......@@ -86,6 +86,9 @@ def _create_subnet(network_id, user_id, cidr, name, ipversion=4, gateway=None,
except Network.DoesNotExist:
raise api.faults.ItemNotFound("No network found with that id")
if network.deleted:
raise api.faults.BadRequest("Network has been deleted")
if user_id != network.userid:
raise api.faults.Unauthorized("Unauthorized operation")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment