1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-10-17 04:17:26 +00:00

Fixed issue in Repository serializer

This commit is contained in:
Lorenzo Balugani 2021-04-28 22:06:28 +02:00
parent aaab6094a9
commit ae6c906395
2 changed files with 9 additions and 3 deletions

View file

@ -6,7 +6,12 @@
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://localhost:5432/PdSDev</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="nest@zero.ryg.one" uuid="78c48f2a-dd96-4b7f-942c-1e3346ac2c26">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://zero.ryg.one:5432/nest</jdbc-url>
</data-source>
</component>
</project>

View file

@ -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()}