Revision 7a0ac0d1 flowspec/forms.py
b/flowspec/forms.py | ||
---|---|---|
111 | 111 |
for route in existing_routes: |
112 | 112 |
if name != route.name: |
113 | 113 |
existing_url = reverse('edit-route', args=[route.name]) |
114 |
if IPNetwork(destination) in IPNetwork(route.destination): |
|
115 |
raise forms.ValidationError('There is an exact %s rule, %s whose destination (%s) is supernet of (or the same as) network (%s).<br>To avoid overlapping try editing rule <a href=\'%s\'>%s</a>' %(route.status, route.name, route.destination, destination, existing_url, route.name)) |
|
116 |
if IPNetwork(route.destination) in IPNetwork(destination): |
|
117 |
raise forms.ValidationError('There is an exact %s rule, %s whose destination network (%s) belongs to the destination network %s.<br>To avoid overlapping try editing rule <a href=\'%s\'>%s</a>' %(route.status, route.name, route.destination, destination, existing_url, route.name)) |
|
118 |
|
|
119 |
|
|
114 |
if IPNetwork(destination) in IPNetwork(route.destination) or IPNetwork(route.destination) in IPNetwork(destination): |
|
115 |
raise forms.ValidationError('Found an exact %s rule, %s with destination prefix %s<br>To avoid overlapping try editing rule <a href=\'%s\'>%s</a>' %(route.status, route.name, route.destination, existing_url, route.name)) |
|
120 | 116 |
return self.cleaned_data |
121 | 117 |
|
122 | 118 |
class ThenPlainForm(forms.ModelForm): |
Also available in: Unified diff