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
af6220f5
authored
Mar 14, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add missing permission checks to __add_port()
parent
4e1f7ab1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
circle/dashboard/views.py
+9
-2
No files found.
circle/dashboard/views.py
View file @
af6220f5
...
...
@@ -349,11 +349,18 @@ class VmDetailView(CheckedDetailView):
try
:
error
=
None
host
=
Host
.
objects
.
get
(
pk
=
request
.
POST
.
get
(
"host_pk"
))
interfaces
=
object
.
interface_set
.
all
()
host
=
Host
.
objects
.
get
(
pk
=
request
.
POST
.
get
(
"host_pk"
),
interface__in
=
interfaces
)
host
.
add_port
(
proto
,
private
=
port
)
except
Host
.
DoesNotExist
:
logger
.
error
(
'Tried to add port to nonexistent host
%
d. User:
%
s. '
'Instance:
%
s'
,
request
.
POST
.
get
(
"host_pk"
),
unicode
(
request
.
user
),
object
)
raise
PermissionDenied
()
except
ValueError
:
error
=
_
(
"There is a problem with your input!"
)
except
Exception
,
e
:
except
Exception
as
e
:
error
=
u', '
.
join
(
e
.
messages
)
if
request
.
is_ajax
():
...
...
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