[clean] PEP8 cleanup

This commit is contained in:
Ferdinand Thiessen 2021-11-22 15:31:53 +01:00
parent 9b935541b0
commit 7cac708309
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,6 @@ from . import event_controller, permissions, EventPlugin
from ...utils.HTTP import no_content
def dict_get(self, key, default=None, type=None):
"""Same as .get from MultiDict"""
try:
@ -340,11 +339,11 @@ def modify_event(event_id, current_session):
event.start = dict_get(data, "start", event.start, type=from_iso_format)
event.end = dict_get(data, "end", event.end, type=from_iso_format)
event.name = dict_get(data, "name", event.name, type=str)
event.description = dict_get(data, "description", event.description, type=str)
event.description = dict_get(data, "description", event.description, type=str)
if "type" in data:
event_type = event_controller.get_event_type(data["type"])
event.type = event_type
event_controller.update()
return jsonify(event)
@ -427,7 +426,7 @@ def update_job(event_id, job_id, current_session: Session):
"""
if not current_session.user_.has_permission(permissions.EDIT):
raise Forbidden
data = request.get_json()
if not data:
raise BadRequest
@ -510,4 +509,5 @@ def lock_job(job_id, current_session: Session):
raise BadRequest
return no_content()
# TODO: JobTransfer

View File

@ -738,7 +738,7 @@ def set_picture(identifier, current_session):
@PriceListPlugin.blueprint.route("/drinks/<int:identifier>/picture", methods=["GET"])
#@headers({"Cache-Control": "private, must-revalidate"})
# @headers({"Cache-Control": "private, must-revalidate"})
def _get_picture(identifier):
"""Get Picture