Skip to content

Commit

Permalink
Remove PARENT_HOST suffix from regex
Browse files Browse the repository at this point in the history
  • Loading branch information
tok3rat0r committed Jun 1, 2023
1 parent c7071c8 commit 7380982
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions django_hosts/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ def __init__(self, regex, urlconf, name, callback=None, prefix='',
The pattern is also suffixed by the PARENT_HOST setting if it exists.
"""
self.regex = regex
parent_host = getattr(settings, 'PARENT_HOST', '').lstrip('.')
suffix = r'\.' + parent_host if parent_host else ''
self.compiled_regex = re.compile(r'%s%s(\.|:|$)' % (regex, suffix))
self.compiled_regex = re.compile(r'%s(\.|:|$)' % regex)
self.urlconf = urlconf
self.name = name
self._scheme = scheme
Expand Down

0 comments on commit 7380982

Please sign in to comment.