|
|
|
@ -28,7 +28,7 @@ def asblockFreeAS(request):
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
mnts = request.user.maintainer_set.all()
|
|
|
|
|
block = ASBlock.objects.filter(mnt_by__in=mnts).distinct().get(handle=blockName)
|
|
|
|
|
block = ASBlock.objects.filter(Q(mnt_by__in=mnts) | Q(mnt_lower__in=mnts)).distinct().get(handle=blockName)
|
|
|
|
|
if block.asblock_set.count() > 0:
|
|
|
|
|
raise ValidationError("AS Block already has sub AS Blocks")
|
|
|
|
|
if block.asnumber_set.count() > 0:
|
|
|
|
@ -72,7 +72,7 @@ def freeSubnet(request):
|
|
|
|
|
parentRange = None
|
|
|
|
|
try:
|
|
|
|
|
mnts = request.user.maintainer_set.all()
|
|
|
|
|
parentRange = InetNum.objects.filter(mnt_by__in=mnts).distinct().get(handle=parentRangeName)
|
|
|
|
|
parentRange = InetNum.objects.filter(Q(mnt_by__in=mnts) | Q(mnt_lower__in=mnts)).distinct().get(handle=parentRangeName)
|
|
|
|
|
except InetNum.DoesNotExist:
|
|
|
|
|
raise ValidationError("Parent range does not exist / is not maintained by you")
|
|
|
|
|
|
|
|
|
|