Skip to content
Snippets Groups Projects
Commit 6d08aa86 authored by David Schmitz's avatar David Schmitz
Browse files

fix a whitespace issue

parent f61ad0bf
No related branches found
No related tags found
No related merge requests found
...@@ -196,23 +196,23 @@ def check_if_rule_exists(fields, queryset): ...@@ -196,23 +196,23 @@ def check_if_rule_exists(fields, queryset):
""" """
if not settings.DISABLE_RULE_OVERLAP_CHECK: if not settings.DISABLE_RULE_OVERLAP_CHECK:
routes = queryset.filter( routes = queryset.filter(
source=fields.get('source'), source=fields.get('source'),
destination=IPNetwork(fields.get('destination')).compressed, destination=IPNetwork(fields.get('destination')).compressed,
) )
if routes: if routes:
ids = [str(item[0]) for item in routes.values_list('pk')] ids = [str(item[0]) for item in routes.values_list('pk')]
return ( return (
True, _('Rule(s) regarding those addresses already exist ' True, _('Rule(s) regarding those addresses already exist '
'with id(s) {}. Please edit those instead'.format(', '.join(ids)))) 'with id(s) {}. Please edit those instead'.format(', '.join(ids))))
routes = Route.objects.filter( routes = Route.objects.filter(
source=fields.get('source'), source=fields.get('source'),
destination=IPNetwork(fields.get('destination')).compressed, destination=IPNetwork(fields.get('destination')).compressed,
) )
for route in routes: for route in routes:
return ( return (
True, _('Rule(s) regarding those addresses already exist ' True, _('Rule(s) regarding those addresses already exist '
'but you cannot edit them. Please refer to the ' 'but you cannot edit them. Please refer to the '
'application\'s administrators for further clarification')) 'application\'s administrators for further clarification'))
return (False, None) return (False, None)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment