From 46890fbbaa27dd964066c81593b8d19b417dccf8 Mon Sep 17 00:00:00 2001 From: Kieran Black Date: Sun, 12 Nov 2023 19:36:21 -0500 Subject: [PATCH] fix: refresh model list when legacy addon adds notetype (#2825) * refresh model list when legacy addon adds notetype When legacy addons add note types, they automatically add the note type to the collection models. When this was detected, the dialog box presenting the list of models was not being updated due to an early return in the code. This commit adds a list refresh along this path of execution to ensure the gui is updated with the newly added model. * add trailing space to name in CONTRIBUTORS --- CONTRIBUTORS | 2 +- qt/aqt/models.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9bca2d7b4..e0043bd5f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -118,7 +118,7 @@ yellowjello Ingemar Berg Ben Kerman Euan Kemp -Kieran Black +Kieran Black XeR mgrottenthaler Austin Siew diff --git a/qt/aqt/models.py b/qt/aqt/models.py index 6f004ca77..2ad890616 100644 --- a/qt/aqt/models.py +++ b/qt/aqt/models.py @@ -147,6 +147,7 @@ class Models(QDialog): def on_success(notetype: NotetypeDict) -> None: # if legacy add-ons already added the notetype, skip adding if notetype["id"]: + self.refresh_list() return # prompt for name