Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
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
beat
beat.web
Commits
fe909090
Commit
fe909090
authored
6 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[plotters][api] Fix key search in dictionaries
parent
8730e9c6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!255
1.4.x
,
!242
Py3 compatibility
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/plotters/api.py
+6
-6
6 additions, 6 deletions
beat/web/plotters/api.py
with
6 additions
and
6 deletions
beat/web/plotters/api.py
+
6
−
6
View file @
fe909090
...
@@ -281,14 +281,14 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
...
@@ -281,14 +281,14 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
raise
serializers
.
ValidationError
({
'
data
'
:
'
Empty
'
})
raise
serializers
.
ValidationError
({
'
data
'
:
'
Empty
'
})
if
data
.
has_key
(
'
short_description
'
)
:
if
'
short_description
'
in
data
:
if
not
(
isinstance
(
data
[
'
short_description
'
],
six
.
string_types
)):
if
not
(
isinstance
(
data
[
'
short_description
'
],
six
.
string_types
)):
raise
serializers
.
ValidationError
({
'
short_description
'
,
'
Invalid short_description data
'
})
raise
serializers
.
ValidationError
({
'
short_description
'
,
'
Invalid short_description data
'
})
short_description
=
data
[
'
short_description
'
]
short_description
=
data
[
'
short_description
'
]
else
:
else
:
short_description
=
None
short_description
=
None
if
data
.
has_key
(
'
description
'
)
:
if
'
description
'
in
data
:
if
not
(
isinstance
(
data
[
'
description
'
],
six
.
string_types
)):
if
not
(
isinstance
(
data
[
'
description
'
],
six
.
string_types
)):
raise
serializers
.
ValidationError
({
'
description
'
:
'
Invalid description data
'
})
raise
serializers
.
ValidationError
({
'
description
'
:
'
Invalid description data
'
})
description
=
data
[
'
description
'
]
description
=
data
[
'
description
'
]
...
@@ -299,13 +299,13 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
...
@@ -299,13 +299,13 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
else
:
else
:
description
=
None
description
=
None
if
data
.
has_key
(
'
strict
'
)
:
if
'
strict
'
in
data
:
strict
=
data
[
'
strict
'
]
strict
=
data
[
'
strict
'
]
else
:
else
:
strict
=
True
strict
=
True
plotter
=
None
plotter
=
None
if
data
.
has_key
(
'
plotter
'
)
:
if
'
plotter
'
in
data
:
try
:
try
:
if
isinstance
(
data
[
'
plotter
'
],
int
):
if
isinstance
(
data
[
'
plotter
'
],
int
):
plotter
=
Plotter
.
objects
.
get
(
id
=
data
[
'
plotter
'
])
plotter
=
Plotter
.
objects
.
get
(
id
=
data
[
'
plotter
'
])
...
@@ -318,11 +318,11 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
...
@@ -318,11 +318,11 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi
raise
serializers
.
ValidationError
({
'
short_description
'
:
'
Short description too long
'
})
raise
serializers
.
ValidationError
({
'
short_description
'
:
'
Short description too long
'
})
customdata
=
None
customdata
=
None
if
data
.
has_key
(
'
customdata
'
)
:
if
'
customdata
'
in
data
:
customdata
=
json
.
dumps
(
data
[
'
customdata
'
])
customdata
=
json
.
dumps
(
data
[
'
customdata
'
])
# Process the query string
# Process the query string
if
request
.
GET
.
has_key
(
'
fields
'
)
:
if
'
fields
'
in
request
.
GET
:
fields_to_return
=
request
.
GET
[
'
fields
'
].
split
(
'
,
'
)
fields_to_return
=
request
.
GET
[
'
fields
'
].
split
(
'
,
'
)
else
:
else
:
# Available fields (not returned by default):
# Available fields (not returned by default):
...
...
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