Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flowspy
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
flowspy
Commits
c00eba1c
Commit
c00eba1c
authored
13 years ago
by
Leonidas Poulopoulos
Browse files
Options
Downloads
Patches
Plain Diff
Replaced simplejson imports with json
parent
e7a73512
No related branches found
Branches containing commit
Tags
v0.7.9.1
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flowspec/views.py
+2
-3
2 additions, 3 deletions
flowspec/views.py
poller/views.py
+1
-2
1 addition, 2 deletions
poller/views.py
with
3 additions
and
5 deletions
flowspec/views.py
+
2
−
3
View file @
c00eba1c
...
...
@@ -15,7 +15,6 @@ from django.shortcuts import get_object_or_404, render_to_response
from
django.core.context_processors
import
request
from
django.template.context
import
RequestContext
from
django.template.loader
import
get_template
,
render_to_string
from
django.utils
import
simplejson
from
django.core.urlresolvers
import
reverse
from
django.contrib
import
messages
from
flowspy.accounts.models
import
*
...
...
@@ -313,7 +312,7 @@ def add_rate_limit(request):
response_data
=
{}
response_data
[
'
pk
'
]
=
"
%s
"
%
then
.
pk
response_data
[
'
value
'
]
=
"
%s:%s
"
%
(
then
.
action
,
then
.
action_value
)
return
HttpResponse
(
simple
json
.
dumps
(
response_data
),
mimetype
=
'
application/json
'
)
return
HttpResponse
(
json
.
dumps
(
response_data
),
mimetype
=
'
application/json
'
)
else
:
return
render_to_response
(
'
add_rate_limit.html
'
,
{
'
form
'
:
form
,},
context_instance
=
RequestContext
(
request
))
...
...
@@ -333,7 +332,7 @@ def add_port(request):
response_data
=
{}
response_data
[
'
value
'
]
=
"
%s
"
%
port
.
pk
response_data
[
'
text
'
]
=
"
%s
"
%
port
.
port
return
HttpResponse
(
simple
json
.
dumps
(
response_data
),
mimetype
=
'
application/json
'
)
return
HttpResponse
(
json
.
dumps
(
response_data
),
mimetype
=
'
application/json
'
)
else
:
return
render_to_response
(
'
add_port.html
'
,
{
'
form
'
:
form
,},
context_instance
=
RequestContext
(
request
))
...
...
This diff is collapsed.
Click to expand it.
poller/views.py
+
1
−
2
View file @
c00eba1c
...
...
@@ -4,7 +4,6 @@ from gevent.pool import Pool
import
json
import
uuid
import
simplejson
import
datetime
from
django.shortcuts
import
render_to_response
from
django.template.loader
import
render_to_string
...
...
@@ -34,7 +33,7 @@ def create_message(body, user):
def
json_response
(
value
,
**
kwargs
):
kwargs
.
setdefault
(
'
content_type
'
,
'
text/javascript; charset=UTF-8
'
)
return
HttpResponse
(
simple
json
.
dumps
(
value
),
**
kwargs
)
return
HttpResponse
(
json
.
dumps
(
value
),
**
kwargs
)
class
Msgs
(
object
):
cache_size
=
500
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment