forked from kompetenzinventar/ki-backend
cast hours to int #56
This commit is contained in:
parent
1287893698
commit
111d4f08f4
@ -138,7 +138,16 @@ def update_profile(user_id: int):
|
|||||||
profile.volunteerwork = request.json.get("volunteerwork", "")
|
profile.volunteerwork = request.json.get("volunteerwork", "")
|
||||||
profile.availability_status = request.json.get("availability_status", False)
|
profile.availability_status = request.json.get("availability_status", False)
|
||||||
profile.availability_text = request.json.get("availability_text", "")
|
profile.availability_text = request.json.get("availability_text", "")
|
||||||
profile.availability_hours_per_week = request.json.get("availability_hours_per_week", 0)
|
|
||||||
|
availability_hours_per_week_raw = request.json.get("availability_hours_per_week", 0)
|
||||||
|
|
||||||
|
try:
|
||||||
|
availability_hours_per_week = int(availability_hours_per_week_raw)
|
||||||
|
except:
|
||||||
|
availability_hours_per_week = 0
|
||||||
|
|
||||||
|
profile.availability_hours_per_week = availability_hours_per_week
|
||||||
|
|
||||||
profile.freetext = request.json.get("freetext", "")
|
profile.freetext = request.json.get("freetext", "")
|
||||||
profile.visible = request.json.get("visible", False)
|
profile.visible = request.json.get("visible", False)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user