From d86431a7cd7e915048f6092ebdea29756b5eec53 Mon Sep 17 00:00:00 2001 From: Saurav Sharma Date: Wed, 14 Feb 2024 16:11:18 +0530 Subject: [PATCH] Regex support fix for IGNORE_URLS --- django_guid/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django_guid/utils.py b/django_guid/utils.py index c7ee70c..1dd57a0 100644 --- a/django_guid/utils.py +++ b/django_guid/utils.py @@ -103,11 +103,11 @@ def is_url_in_ignored_list(request: Union['HttpRequest', 'HttpResponse']) -> boo """ endpoint = request.path.strip('/') for ignore_url in settings.ignore_urls: - pattern = ignore_url.replace("*", "[\s\S]+") + pattern = ignore_url.replace("*", r"[\s\S]+") pattern = "^" + pattern + "$" search = re.search(pattern, endpoint) if search: - logger.info("URL Ignored") + # logger.info("URL Ignored") return True - logger.info("URL not Ignored") + # logger.info("URL not Ignored") return False