Skip to content

Commit

Permalink
Merge pull request #481 from ederag/forbid-unparseable-take2
Browse files Browse the repository at this point in the history
Forbid unparseable facts
  • Loading branch information
ederag authored Nov 23, 2019
2 parents 660fc55 + c3da6a2 commit 556d31a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hamster/edit_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ def validate_fields(self):
self.update_status(status="warning", markup=markup)
return fact

roundtrip_fact = Fact.parse(fact.serialized())
if roundtrip_fact != fact:
self.update_status(status="wrong", markup="Fact could not be parsed back")
return None

# nothing unusual
self.update_status(status="looks good", markup="")
return fact
Expand Down

0 comments on commit 556d31a

Please sign in to comment.