Updates match_aov_pattern() logic to handle empty regex

Using `is not None` to simplify code and handle empty regex cases.

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Allan I. A 2022-03-31 18:59:44 +03:00 committed by GitHub
parent 2d038efde5
commit 995ff7b94a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,9 +19,6 @@ def match_aov_pattern(host_name, aov_patterns, render_file_name):
bool: Review state for rendered file (render_file_name).
"""
aov_pattern = aov_patterns.get(host_name, [])
if aov_pattern:
if re.match(aov_pattern, render_file_name):
preview = True
return preview
else:
return False
if not aov_pattern:
return False
return re.match(aov_pattern, render_file_name) is not None