Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
df34da69
authored
Oct 04, 2017
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard, requests: eleminate more RequestContexts
parent
98e0ef2b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
circle/dashboard/views/node.py
+6
-4
circle/dashboard/views/store.py
+1
-2
circle/request/forms.py
+1
-3
No files found.
circle/dashboard/views/node.py
View file @
df34da69
...
@@ -27,7 +27,6 @@ from django.db.models import Count
...
@@ -27,7 +27,6 @@ from django.db.models import Count
from
django.forms.models
import
inlineformset_factory
from
django.forms.models
import
inlineformset_factory
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.shortcuts
import
redirect
from
django.shortcuts
import
redirect
from
django.template
import
RequestContext
from
django.template.loader
import
render_to_string
from
django.template.loader
import
render_to_string
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
django.views.generic
import
DetailView
,
TemplateView
,
View
from
django.views.generic
import
DetailView
,
TemplateView
,
View
...
@@ -330,9 +329,12 @@ class NodeActivityView(LoginRequiredMixin, SuperuserRequiredMixin, View):
...
@@ -330,9 +329,12 @@ class NodeActivityView(LoginRequiredMixin, SuperuserRequiredMixin, View):
response
=
{
response
=
{
'activities'
:
render_to_string
(
'activities'
:
render_to_string
(
"dashboard/node-detail/_activity-timeline.html"
,
"dashboard/node-detail/_activity-timeline.html"
,
RequestContext
(
request
,
{
'activities'
:
activities
,
{
'show_show_all'
:
show_show_all
}
'activities'
:
activities
,
)
.
flatten
())
'show_show_all'
:
show_show_all
},
request
)
}
}
return
HttpResponse
(
return
HttpResponse
(
...
...
circle/dashboard/views/store.py
View file @
df34da69
...
@@ -29,7 +29,6 @@ from django.core.exceptions import SuspiciousOperation
...
@@ -29,7 +29,6 @@ from django.core.exceptions import SuspiciousOperation
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.shortcuts
import
redirect
,
render_to_response
,
render
from
django.shortcuts
import
redirect
,
render_to_response
,
render
from
django.template
import
RequestContext
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.http
import
require_GET
,
require_POST
from
django.views.decorators.http
import
require_GET
,
require_POST
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
...
@@ -65,7 +64,7 @@ class StoreList(LoginRequiredMixin, TemplateView):
...
@@ -65,7 +64,7 @@ class StoreList(LoginRequiredMixin, TemplateView):
context
=
self
.
get_context_data
(
**
kwargs
)
context
=
self
.
get_context_data
(
**
kwargs
)
return
render_to_response
(
return
render_to_response
(
"dashboard/store/_list-box.html"
,
"dashboard/store/_list-box.html"
,
RequestContext
(
self
.
request
,
context
)
.
flatten
(),
context
,
self
.
request
)
)
else
:
else
:
return
super
(
StoreList
,
self
)
.
get
(
*
args
,
**
kwargs
)
return
super
(
StoreList
,
self
)
.
get
(
*
args
,
**
kwargs
)
...
...
circle/request/forms.py
View file @
df34da69
...
@@ -19,7 +19,6 @@ from django.forms import (
...
@@ -19,7 +19,6 @@ from django.forms import (
Textarea
,
ValidationError
Textarea
,
ValidationError
)
)
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.template
import
RequestContext
from
django.template.loader
import
render_to_string
from
django.template.loader
import
render_to_string
from
sizefield.widgets
import
FileSizeWidget
from
sizefield.widgets
import
FileSizeWidget
...
@@ -68,8 +67,7 @@ class InitialFromFileMixin(object):
...
@@ -68,8 +67,7 @@ class InitialFromFileMixin(object):
super
(
InitialFromFileMixin
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
InitialFromFileMixin
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
initial
[
'message'
]
=
render_to_string
(
self
.
initial
[
'message'
]
=
render_to_string
(
self
.
initial_template
,
self
.
initial_template
,
{},
request
RequestContext
(
request
,
{})
.
flatten
(),
)
)
def
clean_message
(
self
):
def
clean_message
(
self
):
...
...
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