Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
0ff9dd7f
Verified
Commit
0ff9dd7f
authored
Jun 07, 2022
by
Andrey Vertiprahov
Browse files
Add Clean fields to exclude validation.
parent
fb539ce7
Pipeline
#36570
failed with stages
in 18 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/model/base.py
View file @
0ff9dd7f
...
...
@@ -20,7 +20,7 @@ class NOCModelBase(ModelBase):
:param kwargs:
:return:
"""
self
.
full_clean
(
validate_unique
=
False
)
self
.
full_clean
(
validate_unique
=
False
,
exclude
=
getattr
(
self
,
"_clean_fields"
,
None
)
)
super
(
m
,
self
).
save
(
*
args
,
**
kwargs
)
is_base
=
name
==
"NOCModel"
...
...
ip/models/address.py
View file @
0ff9dd7f
...
...
@@ -123,6 +123,7 @@ class Address(NOCModel):
)
csv_ignored_fields
=
[
"prefix"
]
_clean_fields
=
[
"vrf"
,
"prefix"
,
"afi"
]
def
__str__
(
self
):
return
"%s(%s): %s"
%
(
self
.
vrf
.
name
,
self
.
afi
,
self
.
address
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment