Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
5404d2dc
Commit
5404d2dc
authored
3 years ago
by
robban64
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove background_image by sending -1
parent
5aa1a2c0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#42799
passed
3 years ago
Stage: setup
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/app/apis/competitions.py
+1
-1
1 addition, 1 deletion
server/app/apis/competitions.py
server/app/apis/slides.py
+1
-1
1 addition, 1 deletion
server/app/apis/slides.py
server/app/database/controller/edit.py
+14
-0
14 additions, 0 deletions
server/app/database/controller/edit.py
with
16 additions
and
2 deletions
server/app/apis/competitions.py
+
1
−
1
View file @
5404d2dc
...
...
@@ -54,7 +54,7 @@ class Competitions(Resource):
def
put
(
self
,
competition_id
):
args
=
competition_edit_parser
.
parse_args
(
strict
=
True
)
item
=
dbc
.
get
.
one
(
Competition
,
competition_id
)
item
=
dbc
.
edit
.
default
(
item
,
**
args
)
item
=
dbc
.
edit
.
competition
(
item
,
**
args
)
return
item_response
(
schema
.
dump
(
item
))
...
...
This diff is collapsed.
Click to expand it.
server/app/apis/slides.py
+
1
−
1
View file @
5404d2dc
...
...
@@ -43,7 +43,7 @@ class Slides(Resource):
args
=
slide_parser
.
parse_args
(
strict
=
True
)
item_slide
=
dbc
.
get
.
slide
(
competition_id
,
slide_id
)
item_slide
=
dbc
.
edit
.
default
(
item_slide
,
**
args
)
item_slide
=
dbc
.
edit
.
slide
(
item_slide
,
**
args
)
return
item_response
(
schema
.
dump
(
item_slide
))
...
...
This diff is collapsed.
Click to expand it.
server/app/database/controller/edit.py
+
14
−
0
View file @
5404d2dc
...
...
@@ -51,3 +51,17 @@ def default(item, **kwargs):
db.session.commit()
db.session.refresh(item)
return item
def competition(item, **kwargs):
if kwargs[
"
background_image_id
"
] == -1:
item.background_image_id = None
del kwargs[
"
background_image_id
"
]
return default(item, **kwargs)
def slide(item, **kwargs):
if kwargs[
"
background_image_id
"
] == -1:
item.background_image_id = None
del kwargs[
"
background_image_id
"
]
return default(item, **kwargs)
\ No newline at end of file
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