Add FastAPI dashboard MVP
This commit is contained in:
@@ -66,12 +66,19 @@ class Correctness:
|
||||
return self.confirmations / total
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
# Backwards/robustness: older code paths may have appended raw dicts.
|
||||
review_history: List[dict] = []
|
||||
for entry in self.review_history:
|
||||
if isinstance(entry, dict):
|
||||
review_history.append(entry)
|
||||
else:
|
||||
review_history.append(entry.to_dict())
|
||||
return {
|
||||
"confirmed": self.confirmed,
|
||||
"confirmations": self.confirmations,
|
||||
"rejections": self.rejections,
|
||||
"last_reviewed": self.last_reviewed,
|
||||
"review_history": [r.to_dict() for r in self.review_history],
|
||||
"review_history": review_history,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user