Skip to content

Commit

Permalink
Fix missing variable
Browse files Browse the repository at this point in the history
  • Loading branch information
aymgal committed Jul 20, 2023
1 parent d913368 commit 12b401e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions coolest/template/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,13 @@ def load(self, verbose=False):
"""
try:
instance = self.load_jsonpickle()
check_instance = True # will then check that it is a COOLEST instance
assert isinstance(instance, COOLEST)
except Exception as e:
if verbose is True:
print(f"Failed reading '{self._api_suffix}' template with jsonpickle, "
f"now trying with the pure json template (original error: {e})")
content = self.load_simple()
assert isinstance(content, COOLEST)
return content
instance = self.load_simple()
return instance

def load_simple(self, as_object=True):
"""Read the JSON template file and build up the corresponding COOLEST object.
Expand Down

0 comments on commit 12b401e

Please sign in to comment.