Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
d72f3fcf
Commit
d72f3fcf
authored
Jul 08, 2014
by
Christos Stavrakakis
Browse files
cyclades: Check length of volume's name/descr
Check the length of the volume's name or description when updating the volume.
parent
2b8d18e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/volume/volumes.py
View file @
d72f3fcf
...
...
@@ -222,8 +222,12 @@ def delete(volume):
@
transaction
.
commit_on_success
def
update
(
volume
,
name
=
None
,
description
=
None
,
delete_on_termination
=
None
):
if
name
is
not
None
:
utils
.
check_name_length
(
name
,
Volume
.
NAME_LENGTH
,
"Volume name is too long"
)
volume
.
name
=
name
if
description
is
not
None
:
utils
.
check_name_length
(
description
,
Volume
.
DESCRIPTION_LENGTH
,
"Volume description is too long"
)
volume
.
description
=
description
if
delete_on_termination
is
not
None
:
validate_volume_termination
(
volume
.
volume_type
,
delete_on_termination
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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