1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #26746 -- Fixed handling of zero priority in Accept-Language header parsing.

This commit is contained in:
Vytis Banaitis
2016-06-13 14:58:25 +03:00
committed by Tim Graham
parent f1b38842af
commit 57eb17b8c7
2 changed files with 2 additions and 2 deletions

View File

@@ -791,7 +791,7 @@ def parse_accept_lang_header(lang_string):
return []
if priority:
priority = float(priority)
if not priority: # if priority is 0.0 at this point make it 1.0
else:
priority = 1.0
result.append((lang, priority))
result.sort(key=lambda k: k[1], reverse=True)