From 99fc5dc13c12d874ffc1c8f47a6421494e720b31 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Sat, 16 Feb 2019 16:43:42 +0900 Subject: Fixed #30141 -- Fixed parse_duration() for some negative durations. --- django/utils/dateparse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'django/utils/dateparse.py') diff --git a/django/utils/dateparse.py b/django/utils/dateparse.py index 8d08b7d1d3..f90d952581 100644 --- a/django/utils/dateparse.py +++ b/django/utils/dateparse.py @@ -29,9 +29,10 @@ datetime_re = re.compile( standard_duration_re = re.compile( r'^' r'(?:(?P-?\d+) (days?, )?)?' - r'((?:(?P-?\d+):)(?=\d+:\d+))?' - r'(?:(?P-?\d+):)?' - r'(?P-?\d+)' + r'(?P-?)' + r'((?:(?P\d+):)(?=\d+:\d+))?' + r'(?:(?P\d+):)?' + r'(?P\d+)' r'(?:\.(?P\d{1,6})\d{0,6})?' r'$' ) -- cgit v1.3