Mbonea commited on
Commit
bad8789
1 Parent(s): 84efe74

fixes the no constants errror

Browse files
Files changed (1) hide show
  1. App/Worker.py +4 -1
App/Worker.py CHANGED
@@ -35,7 +35,10 @@ def create_json_file(assets: List[Assets], asset_dir: str):
35
 
36
  def create_constants_json_file(constants: Constants, asset_dir: str):
37
  filename = "Constants.json"
38
- json_string = json.dumps(constants.dict())
 
 
 
39
  os.makedirs(asset_dir, exist_ok=True)
40
  with open(os.path.join(asset_dir, filename), "w") as f:
41
  f.write(json_string)
 
35
 
36
  def create_constants_json_file(constants: Constants, asset_dir: str):
37
  filename = "Constants.json"
38
+ if constants:
39
+ json_string = json.dumps(constants.dict())
40
+ else:
41
+ json_string = json.dumps({})
42
  os.makedirs(asset_dir, exist_ok=True)
43
  with open(os.path.join(asset_dir, filename), "w") as f:
44
  f.write(json_string)