Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
12a342c9
authored
Apr 04, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: Fixed error messages at share delete.
parent
2c67225b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
one/views.py
+9
-3
No files found.
one/views.py
View file @
12a342c9
...
...
@@ -16,7 +16,7 @@ from django.template import RequestContext
from
django.template.loader
import
render_to_string
from
django.utils.decorators
import
method_decorator
from
django.utils.translation
import
get_language
as
lang
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
,
ungettext_lazy
from
django.views.decorators.http
import
*
from
django.views.generic
import
*
from
firewall.tasks
import
*
...
...
@@ -487,8 +487,14 @@ def vm_unshare(request, id, *args, **kwargs):
if
not
g
.
owners
.
filter
(
user
=
request
.
user
)
.
exists
():
raise
PermissionDenied
()
try
:
if
s
.
get_running_or_stopped
()
>
0
:
messages
.
error
(
request
,
_
(
'There are machines running of this share.'
))
n
=
s
.
get_running
()
m
=
s
.
get_running_or_stopped
()
if
n
>
0
:
messages
.
error
(
request
,
ungettext_lazy
(
'There is a machine running of this share.'
,
'There are
%
d machines running of this share.'
,
n
)
%
n
)
elif
m
>
0
:
messages
.
error
(
request
,
ungettext_lazy
(
'There is a suspended machines of this share.'
,
'There are
%
d suspended machines of this share.'
,
m
)
%
m
)
else
:
s
.
delete
()
messages
.
success
(
request
,
_
(
'Share is successfully removed.'
))
...
...
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