Skip to content

Commit

Permalink
fix: fixed validation correction not being saved
Browse files Browse the repository at this point in the history
  • Loading branch information
ShyAssassin committed Jan 4, 2024
1 parent 8c8ce5e commit c7c3daa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TrackingBackend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ def load(self) -> ConfigManager:
try:
file = open(CONFIG_FILE, "rt", encoding="utf8").read()
self.__dict__.update(self.model_validate_json(file))
if file != json.dumps(self.model_dump(), indent=4):
self.__logger.warning("Config had validation errors, saving validated config")
self.save()
except PermissionError:
self.__logger.error("Permission Denied, assuming config has lock, retrying...")
self.load()
Expand Down

0 comments on commit c7c3daa

Please sign in to comment.