Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
6d08aa86
Commit
6d08aa86
authored
6 years ago
by
David Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
fix a whitespace issue
parent
f61ad0bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flowspec/validators.py
+19
-19
19 additions, 19 deletions
flowspec/validators.py
with
19 additions
and
19 deletions
flowspec/validators.py
+
19
−
19
View file @
6d08aa86
...
...
@@ -196,23 +196,23 @@ def check_if_rule_exists(fields, queryset):
"""
if
not
settings
.
DISABLE_RULE_OVERLAP_CHECK
:
routes
=
queryset
.
filter
(
source
=
fields
.
get
(
'
source
'
),
destination
=
IPNetwork
(
fields
.
get
(
'
destination
'
)).
compressed
,
)
if
routes
:
ids
=
[
str
(
item
[
0
])
for
item
in
routes
.
values_list
(
'
pk
'
)]
return
(
True
,
_
(
'
Rule(s) regarding those addresses already exist
'
'
with id(s) {}. Please edit those instead
'
.
format
(
'
,
'
.
join
(
ids
))))
routes
=
Route
.
objects
.
filter
(
source
=
fields
.
get
(
'
source
'
),
destination
=
IPNetwork
(
fields
.
get
(
'
destination
'
)).
compressed
,
)
for
route
in
routes
:
return
(
True
,
_
(
'
Rule(s) regarding those addresses already exist
'
'
but you cannot edit them. Please refer to the
'
'
application
\'
s administrators for further clarification
'
))
routes
=
queryset
.
filter
(
source
=
fields
.
get
(
'
source
'
),
destination
=
IPNetwork
(
fields
.
get
(
'
destination
'
)).
compressed
,
)
if
routes
:
ids
=
[
str
(
item
[
0
])
for
item
in
routes
.
values_list
(
'
pk
'
)]
return
(
True
,
_
(
'
Rule(s) regarding those addresses already exist
'
'
with id(s) {}. Please edit those instead
'
.
format
(
'
,
'
.
join
(
ids
))))
routes
=
Route
.
objects
.
filter
(
source
=
fields
.
get
(
'
source
'
),
destination
=
IPNetwork
(
fields
.
get
(
'
destination
'
)).
compressed
,
)
for
route
in
routes
:
return
(
True
,
_
(
'
Rule(s) regarding those addresses already exist
'
'
but you cannot edit them. Please refer to the
'
'
application
\'
s administrators for further clarification
'
))
return
(
False
,
None
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment