mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 21:14:18 +00:00
#bugfix Prevista la possibilita' che non esista la data nel database legata a un repository, e restituita stringa vuota nel json in quel caso
This commit is contained in:
parent
e6163d41c3
commit
93d01cb158
1 changed files with 2 additions and 2 deletions
|
@ -22,5 +22,5 @@ class Repository(Base.Model):
|
||||||
uses = Base.relationship("Uses", back_populates="repository")
|
uses = Base.relationship("Uses", back_populates="repository")
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return {"id": self.id, "name": self.name, "start": self.start.isoformat(), "isActive":self.isActive,
|
return {"id": self.id, "name": self.name, "start": (self.start.isoformat() if self.start is not None else ""), "isActive":self.isActive,
|
||||||
"end":self.end.isoformat(),"owner": self.owner.to_json()}
|
"end":(self.end.isoformat() if self.end is not None else ""),"owner": self.owner.to_json()}
|
||||||
|
|
Loading…
Reference in a new issue