Skip to content
This repository was archived by the owner on Oct 13, 2024. It is now read-only.

Commit ffd7b41

Browse files
committed
fix: handle error when writing secret
1 parent 818ad56 commit ffd7b41

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Contents/Code/webapp.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ def render_template(*args, **kwargs):
144144
# create random secret
145145
Log.Info('Creating random secret')
146146
app.secret_key = uuid.uuid4().hex
147-
Core.storage.save(
148-
filename=secret_file,
149-
data=json.dumps({"secret": app.secret_key}),
150-
binary=False)
147+
try:
148+
with open(secret_file, 'w') as f:
149+
json.dump({'secret': app.secret_key}, f)
150+
except Exception as e:
151+
Log.Error('Error saving secret: {}'.format(e))
151152

152153

153154
@babel.localeselector

0 commit comments

Comments
 (0)