Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SMASCH
scheduling-system
Merge requests
!36
Resolve "configuration panel"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "configuration panel"
87-configuration-panel
into
master
Overview
0
Commits
6
Pipelines
1
Changes
5
Merged
Piotr Gawron
requested to merge
87-configuration-panel
into
master
7 years ago
Overview
0
Commits
6
Pipelines
1
Changes
5
Expand
Closes
#87 (closed)
0
0
Merge request reports
Viewing commit
6a6347fc
Prev
Next
Show latest version
5 files
+
67
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
6a6347fc
unit test for configuration api
· 6a6347fc
Piotr Gawron
authored
7 years ago
smash/web/api_views/configuration.py
+
6
−
4
Options
@@ -32,9 +32,10 @@ def configuration_items(request):
"
data
"
:
data
})
@login_required
def
update_configuration_item
(
request
):
id
=
int
(
request
.
GET
.
get
(
"
id
"
,
None
))
id
=
int
(
request
.
GET
.
get
(
"
id
"
,
"
-1
"
))
value
=
request
.
GET
.
get
(
"
value
"
,
None
)
if
(
id
is
None
)
or
(
value
is
None
):
@@ -43,13 +44,14 @@ def update_configuration_item(request):
"
message
"
:
"
id and value are obligatory
"
})
item
=
ConfigurationItem
.
objects
.
get
(
id
=
id
)
if
item
is
None
:
item
s
=
ConfigurationItem
.
objects
.
filter
(
id
=
id
)
if
len
(
items
)
==
0
:
return
JsonResponse
({
"
status
"
:
"
error
"
,
"
message
"
:
"
item with given id doesn
'
t exist
"
})
item
.
value
=
value
item
=
items
[
0
]
item
.
value
=
value
item
.
save
()
return
JsonResponse
({
"
status
"
:
"
ok
"
,
Loading