Skip to content

Commit

Permalink
Regex support linting fix for IGNORE_URLS
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurav Sharma authored and Saurav Sharma committed Feb 14, 2024
1 parent abe5c1b commit 00d163f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_guid/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import re
import uuid
from typing import TYPE_CHECKING, Optional, Union
import re

from django_guid.config import settings

Expand Down Expand Up @@ -103,7 +103,7 @@ 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('*', r'[\s\S]+')
pattern = ignore_url.replace('*', r'[\s\S]+') # noqa
pattern = '^' + pattern + '$'
search = re.search(pattern, endpoint)
if search:
Expand Down

0 comments on commit 00d163f

Please sign in to comment.