Skip to content

Commit 060cadd

Browse files
committedJan 9, 2025·
Merge PR #3160 into 16.0
Signed-off-by NL66278
2 parents 961688e + 8ea268e commit 060cadd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎fetchmail_attach_from_folder/models/fetchmail_server.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55

66
from odoo import _, api, fields, models
7+
from odoo.exceptions import UserError
78

89
_logger = logging.getLogger(__name__)
910

@@ -30,7 +31,11 @@ def parse_list_response(line):
3031
if this.state != "done":
3132
this.folders_available = _("Confirm connection first.")
3233
continue
33-
connection = this.connect()
34+
try:
35+
connection = this.connect()
36+
except UserError:
37+
this.folders_available = _("Confirm connection first.")
38+
continue
3439
list_result = connection.list()
3540
if list_result[0] != "OK":
3641
this.folders_available = _("Unable to retrieve folders.")

0 commit comments

Comments
 (0)
Please sign in to comment.