Skip to content

Commit ef95430

Browse files
committed
fix password not being saved when config file created on old version
If the 'password' field wasn't in the meta.json, we wouldn't try to save the contents of the password field, since we were iterating over each key in the current schema and matching it up with the appropriate field. To fix this, just add it with a blank value if it doesn't already exist before trying to do the save routine. Fixes #61.
1 parent d2a2904 commit ef95430

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

anki-plugin/src/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ def _save_wiki_values(self) -> None:
148148
"""
149149
current_wiki = self.wikis[self.current_wiki_index]
150150
current_wiki[0] = self.form.wikiName.text()
151+
152+
# added to schema in 1.3.0, upgrade if necessary
153+
if 'password' not in current_wiki[1].keys():
154+
current_wiki[1]['password'] = ''
155+
151156
for name in list(current_wiki[1].keys()):
152157
if getattr(self.form, name + '_', None):
153158
control = getattr(self.form, name + '_')

0 commit comments

Comments
 (0)