From ae6c90639510fc084bb4b167a9d27ddc25fdf98b Mon Sep 17 00:00:00 2001 From: Lorenzo Balugani Date: Wed, 28 Apr 2021 22:06:28 +0200 Subject: [PATCH] Fixed issue in Repository serializer --- .idea/dataSources.xml | 7 ++++++- code/backend/nest_backend/database/tables/Repository.py | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 4db843a..5ae724c 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -6,7 +6,12 @@ true org.postgresql.Driver jdbc:postgresql://localhost:5432/PdSDev - $ProjectFileDir$ + + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://zero.ryg.one:5432/nest \ No newline at end of file diff --git a/code/backend/nest_backend/database/tables/Repository.py b/code/backend/nest_backend/database/tables/Repository.py index 7484202..d82df97 100644 --- a/code/backend/nest_backend/database/tables/Repository.py +++ b/code/backend/nest_backend/database/tables/Repository.py @@ -22,5 +22,6 @@ class Repository(Base.Model): uses = Base.relationship("Uses", back_populates="repository") def to_json(self): - return {"id": self.id, "name": self.name, "start": self.start.isoformat(), "isActive":self.isActive, - "end":self.end.isoformat(),"owner": self.owner.to_json()} + return {"id": self.id, "name": self.name, "start": (self.start.isoformat() if self.start else None), + "isActive": self.isActive, "end": (self.end.isoformat() if self.end else None), + "owner": self.owner.to_json()}