Spaces:
Running
Running
charbelmalo
commited on
Commit
·
4b59eec
1
Parent(s):
7b4bce0
Fix indentation in load_shortcuts function to properly handle FileNotFoundError
Browse files
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -16,8 +16,8 @@ def load_shortcuts():
|
|
16 |
shortcuts_list = json.load(f)
|
17 |
for shortcut in shortcuts_list:
|
18 |
shortcut['date_added'] = datetime.fromisoformat(shortcut['date_added'])
|
19 |
-
|
20 |
-
|
21 |
|
22 |
def add_shortcut(name, tags, link, emojis, color_from, color_to, short_description):
|
23 |
new_shortcut = {
|
|
|
16 |
shortcuts_list = json.load(f)
|
17 |
for shortcut in shortcuts_list:
|
18 |
shortcut['date_added'] = datetime.fromisoformat(shortcut['date_added'])
|
19 |
+
except FileNotFoundError:
|
20 |
+
shortcuts_list = []
|
21 |
|
22 |
def add_shortcut(name, tags, link, emojis, color_from, color_to, short_description):
|
23 |
new_shortcut = {
|