fixes the no constants errror
Browse files- 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 |
-
|
|
|
|
|
|
|
|
|
|
| 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)
|