1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

🐛 Fix parameters bug

This commit is contained in:
Stefano Pigozzi 2021-05-02 22:18:07 +02:00
parent d5ef97e128
commit c3d08f1eee
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01

View file

@ -27,7 +27,7 @@ def page_repository_conditions(rid):
return json_success([u.condition.to_json() for u in repository.uses])
if request.method == "POST":
if not (type_ := request.json.get("type")):
if (type_ := request.json.get("type")) is None:
return json_error("Missing `type` parameter."), 400
try:
@ -38,7 +38,7 @@ def page_repository_conditions(rid):
if not (content := request.json.get("content")):
return json_error("Missing `content` parameter."), 400
if not (repo_id := request.json.get("id")):
if (repo_id := request.json.get("id")) is None:
return json_error("Missing `id` parameter."), 400
condition = Condition(content=content, type=type_)