Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TEST_DATABASE_URL=postgresql://dev_user:motdepassedev@51.255.51.83:5433/dev_db
DEV_DATABASE_URL=postgresql://dev_user:motdepassedev@51.255.51.83:5433/dev_db
FLASK_ENV="development"
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
from dotenv import load_dotenv

__version__ = "1.0.1" # géré automatiquement par la CI
__version__ = "0.1.1" # géré automatiquement par la CI


load_dotenv(".env")
Expand Down
18 changes: 9 additions & 9 deletions app/routes/routes1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
from app.services.auth import verify_token
from app.extensions import db
from depsec_db import models
from depsec_db.models import Project
#from depsec_models.models import * #import des modèles depuis le package


Expand All @@ -20,15 +20,15 @@
projects = [
{
"id":1,
"auteur_id":3,
"titre":"Gestion des projets",
"auteur":"Solayman",
"status":"Accept",
"path":"/var/sui"
},
{
"id":2,
"auteur_id":8,
"titre":"Gestion de BDD",
"auteur":"Pierrot la pinto de la mañana",
"status":"Refuse",
"path":"/var/bang"
}
Expand Down Expand Up @@ -91,8 +91,8 @@ def get_projects():
#return return_all_proj(), 200
#return jsonify({"Projects":data.get('titre')}), 200

#projects = Project.query.all()
#return jsonify([user.to_dict() for user in users])
projects = Project.query.all()
return jsonify([project.to_dict() for project in projects])


@projets_bp.route('/', methods=['POST'])
Expand All @@ -106,17 +106,17 @@ def add_project():
if not data :
return jsonify({"error": "Le fomat de vos donnees n'est pas bon !!"}), 400

if data.get("titre") and data.get("auteur") and data.get("status") and data.get("path"):
if data.get("titre") and data.get("auteur_id") and data.get("status") and data.get("path"):
titre = data.get("titre")
auteur = data.get("auteur")
auteur_id = data.get("auteur_id")
status = data.get("status")
path = data.get("path")

if isinstance(auteur, str) and status in ["Accept","Refuse"]:
if isinstance(auteur_id, int) and status in ["Accept","Refuse"]:
format = {
"id":0,
"auteur":auteur_id,
"titre":titre,
"auteur":auteur,
"status":status,
"path":path
}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ python-semantic-release
setuptools
flask_migrate
psycopg2-binary
git+https://github.com/DEPSEC-Project/DB-Management.git
git+https://github.com/DEPSEC-Project/DB-Management.git@main