mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 03:40:38 +08:00
Add error handling for missing custom label settings in utils.py
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user