core: fix upload api not checking clear properly
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
53100a72fe
commit
16c194d2dc
|
@ -202,7 +202,7 @@ class ApplicationViewSet(UsedByMixin, ModelViewSet):
|
||||||
"""Set application icon"""
|
"""Set application icon"""
|
||||||
app: Application = self.get_object()
|
app: Application = self.get_object()
|
||||||
icon = request.FILES.get("file", None)
|
icon = request.FILES.get("file", None)
|
||||||
clear = request.data.get("clear", False)
|
clear = request.data.get("clear", "false").lower() == "true"
|
||||||
if clear:
|
if clear:
|
||||||
# .delete() saves the model by default
|
# .delete() saves the model by default
|
||||||
app.meta_icon.delete()
|
app.meta_icon.delete()
|
||||||
|
|
|
@ -301,7 +301,7 @@ class FlowViewSet(UsedByMixin, ModelViewSet):
|
||||||
"""Set Flow background"""
|
"""Set Flow background"""
|
||||||
flow: Flow = self.get_object()
|
flow: Flow = self.get_object()
|
||||||
background = request.FILES.get("file", None)
|
background = request.FILES.get("file", None)
|
||||||
clear = request.data.get("clear", False)
|
clear = request.data.get("clear", "false").lower() == "true"
|
||||||
if clear:
|
if clear:
|
||||||
if flow.background_url.startswith("/media"):
|
if flow.background_url.startswith("/media"):
|
||||||
# .delete() saves the model by default
|
# .delete() saves the model by default
|
||||||
|
|
Reference in New Issue