diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index 43a57077..bb648060 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -674,14 +674,16 @@ def get_user_labels(current_labels: List[str] = None): Only keep labels that has been added by the user """ try: + enable_custom_labels = get_settings().config.get('enable_custom_labels', False) + custom_labels = get_settings().get('custom_labels', []) if current_labels is None: current_labels = [] user_labels = [] for label in current_labels: if label.lower() in ['bug fix', 'tests', 'enhancement', 'documentation', 'other']: continue - if get_settings().config.enable_custom_labels: - if label in get_settings().custom_labels: + if enable_custom_labels: + if label in custom_labels: continue user_labels.append(label) if user_labels: