Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5880ee1e
authored
Jul 10, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: refactor ops ajax functionality to AjaxOperationMixin
parent
e9439649
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
circle/dashboard/views.py
+9
-6
No files found.
circle/dashboard/views.py
View file @
5880ee1e
...
@@ -608,14 +608,11 @@ class OperationView(RedirectToLoginMixin, DetailView):
...
@@ -608,14 +608,11 @@ class OperationView(RedirectToLoginMixin, DetailView):
return
me
return
me
class
VmOperationView
(
OperationView
):
class
AjaxOperationMixin
(
object
):
model
=
Instance
context_object_name
=
'instance'
# much simpler to mock object
def
post
(
self
,
request
,
extra
=
None
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
extra
=
None
,
*
args
,
**
kwargs
):
resp
=
super
(
VmOperationView
,
self
)
.
post
(
request
,
extra
,
*
args
,
resp
=
super
(
AjaxOperationMixin
,
self
)
.
post
(
**
kwargs
)
request
,
extra
,
*
args
,
**
kwargs
)
if
request
.
is_ajax
():
if
request
.
is_ajax
():
store
=
messages
.
get_messages
(
request
)
store
=
messages
.
get_messages
(
request
)
store
.
used
=
True
store
.
used
=
True
...
@@ -628,6 +625,12 @@ class VmOperationView(OperationView):
...
@@ -628,6 +625,12 @@ class VmOperationView(OperationView):
return
resp
return
resp
class
VmOperationView
(
AjaxOperationMixin
,
OperationView
):
model
=
Instance
context_object_name
=
'instance'
# much simpler to mock object
class
FormOperationMixin
(
object
):
class
FormOperationMixin
(
object
):
form_class
=
None
form_class
=
None
...
...
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