1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 14:34:19 +00:00

Fixed repo conditions

This commit is contained in:
Lorenzo Balugani 2021-05-02 22:41:39 +02:00
parent 16fe48e56b
commit b713be87d5
2 changed files with 4 additions and 7 deletions

View file

@ -38,13 +38,9 @@ def page_repository_conditions(rid):
if not (content := request.json.get("content")): if not (content := request.json.get("content")):
return json_error("Missing `content` parameter."), 400 return json_error("Missing `content` parameter."), 400
if (repo_id := request.json.get("id")) is None:
return json_error("Missing `id` parameter."), 400
condition = Condition(content=content, type=type_) condition = Condition(content=content, type=type_)
Base.session.merge(condition) Base.session.add(condition)
repository = Repository.query.get(repo_id)
use = Uses(cid=condition.id, rid=repository.id) use = Uses(cid=condition.id, rid=repository.id)
Base.session.merge(use) Base.session.merge(use)

View file

@ -1,6 +1,7 @@
import unittest
import requests
import json import json
import unittest
import requests
class MyTestCase(unittest.TestCase): class MyTestCase(unittest.TestCase):