diff --git a/code/backend/nest_backend/app.py b/code/backend/nest_backend/app.py index 4b4ec08..3bca49e 100644 --- a/code/backend/nest_backend/app.py +++ b/code/backend/nest_backend/app.py @@ -1,7 +1,6 @@ from flask import Flask import os - app = Flask(__name__) if os.getenv('COOKIE_SECRET'): app.secret_key = os.getenv('COOKIE_SECRET') @@ -14,4 +13,4 @@ else: if os.getenv("DATABASE_URI"): app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') else: - app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:password@localhost:5432/PdSDev' \ No newline at end of file + app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:password@localhost:5432/PdSDev' diff --git a/code/backend/nest_backend/routes/repository/repository_conditions.py b/code/backend/nest_backend/routes/repository/repository_conditions.py index ad815ac..5b907e8 100644 --- a/code/backend/nest_backend/routes/repository/repository_conditions.py +++ b/code/backend/nest_backend/routes/repository/repository_conditions.py @@ -40,9 +40,10 @@ def page_repository_conditions(rid): condition = Condition(content=content, type=type_) Base.session.add(condition) + Base.session.commit() use = Uses(cid=condition.id, rid=repository.id) Base.session.merge(use) - Base.session.commit() + return json_success(condition.to_json()), 200