Commit a7028865 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Fix bug in creating network

Exclude deleted networks.
parent f0d40da5
......@@ -172,8 +172,9 @@ def create_network(request):
if typ == 'PUBLIC_ROUTED':
raise Unauthorized('Can not create a public network.')
user_networks = len(Network.objects.filter(userid=request.user_uniq))
if user_networks > settings.MAX_NETWORKS_PER_USER:
user_networks = len(Network.objects.filter(userid=request.user_uniq,
if user_networks == settings.MAX_NETWORKS_PER_USER:
raise OverLimit('Network count limit exceeded for your account.')
cidr_block = int(subnet.split('/')[1])
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