diff --git a/src/fime/import_task.py b/src/fime/import_task.py index 677e963..875cd74 100644 --- a/src/fime/import_task.py +++ b/src/fime/import_task.py @@ -89,7 +89,7 @@ class ImportTask(QtWidgets.QDialog): def showEvent(self, _): self.auto_change_task_check_box.setChecked(self.config.import_auto_change_task) # pick up config changes - self.completer.update_urls() + self.completer.update() self.line_edit.setText("") self.raise_() self.line_edit.setFocus() diff --git a/src/fime/task_completer.py b/src/fime/task_completer.py index 308b9e3..a7b6127 100644 --- a/src/fime/task_completer.py +++ b/src/fime/task_completer.py @@ -33,13 +33,12 @@ class TaskCompleter(QtWidgets.QCompleter): self.setCaseSensitivity(QtCore.Qt.CaseInsensitive) self.session = FuturesSession() self.session.headers["Accept"] = "application/json" - add_auth(config, self.session) self.config = config self.picker_url = None self.search_url = None self.issue_url_tmpl = None self.issue_key_regex = re.compile(r"^[a-zA-Z0-9]+-[0-9]+") - self.update_urls() + self.update() self.text = "" self.response_text = "" self.model_data = set() @@ -53,10 +52,12 @@ class TaskCompleter(QtWidgets.QCompleter): self.rif_counter_lock = threading.Lock() self.last_rif_state = TaskCompleter.RifState.STOPPED - def update_urls(self): + def update(self): self.picker_url = os.path.join(self.config.jira_url, "rest/api/2/issue/picker") self.search_url = os.path.join(self.config.jira_url, "rest/api/2/search") self.issue_url_tmpl = os.path.join(self.config.jira_url, "rest/api/2/issue/{}") + self.session = FuturesSession() + add_auth(self.config, self.session) @QtCore.Slot() def process_response(self):