Make settings regex non greedy.

I'm surprised this didn't cause an issue before but as far as I can
figure this should always be non-greedy.  I think it worked before
because the items we were looking for was previously the last item
in the list but that is no longer the case in python 3 because of
dictionary order changes.
This commit is contained in:
Feanil Patel
2019-10-22 10:12:35 -04:00
parent 7dbee1c3dd
commit 5bfdcad0f5

View File

@@ -281,7 +281,7 @@ class Env(object):
"""
django_setting_value = cls.get_django_setting(django_setting, system, settings)
pattern = re.compile(
u"[\"']{setting}[\"']: [\"'](?P<setting_value>.*)[\"']".format(setting=nested_django_setting)
u"[\"']{setting}[\"']: [\"'](?P<setting_value>.*?)[\"']".format(setting=nested_django_setting)
)
match = pattern.search(django_setting_value)
if match: