mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-28 23:44:19 +00:00
Now repositories are activated immediately.
This commit is contained in:
parent
351a8ba0ab
commit
312ce7a208
1 changed files with 4 additions and 1 deletions
|
@ -74,7 +74,7 @@ def page_repositories():
|
||||||
"spectator": [r.repository.to_json() for r in spectator]})
|
"spectator": [r.repository.to_json() for r in spectator]})
|
||||||
elif request.method == "POST":
|
elif request.method == "POST":
|
||||||
# Users will be tolerated if they change parameters they're not supposed to touch. We'll ignore them for now.
|
# Users will be tolerated if they change parameters they're not supposed to touch. We'll ignore them for now.
|
||||||
if not request.json.get("name") or not request.json.get("conditions") or not request.json.get("evaluation_mode"):
|
if not request.json.get("name") or not request.json.get("conditions") or not str(request.json.get("evaluation_mode")):
|
||||||
return json_error("Missing arguments."), 400
|
return json_error("Missing arguments."), 400
|
||||||
name = request.json.get("name")
|
name = request.json.get("name")
|
||||||
try:
|
try:
|
||||||
|
@ -94,4 +94,7 @@ def page_repositories():
|
||||||
return json_error("Unknown `type` specified."), 400
|
return json_error("Unknown `type` specified."), 400
|
||||||
ext.session.add(Condition(type=type_, content=c['content'], repository_id=repository.id))
|
ext.session.add(Condition(type=type_, content=c['content'], repository_id=repository.id))
|
||||||
ext.session.commit()
|
ext.session.commit()
|
||||||
|
repository.is_active = True
|
||||||
|
repository.start = datetime.datetime.now()
|
||||||
|
ext.session.commit()
|
||||||
return json_success(repository.to_json()), 201
|
return json_success(repository.to_json()), 201
|
||||||
|
|
Loading…
Reference in a new issue