Skip to content

Commit 1a661a0

Browse files
xmo-odooXavier-Do
authored andcommitted
[IMP] runbot: simplify regex check
1 parent 6b688be commit 1a661a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runbot/models/build_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ def _validate(self):
12321232
except re.error as e:
12331233
raise ValidationError("Unable to compile regular expression: %s" % e)
12341234
# verify that a named group exist in the pattern
1235-
if not re.search(r'\(\?P<\w+>.+\)', r.pattern):
1235+
if not r.groupindex:
12361236
raise ValidationError(
12371237
"The regular expresion should contain at least one named group pattern e.g: '(?P<module>.+)'"
12381238
)

0 commit comments

Comments
 (0)