1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #28530 -- Prevented SelectDateWidget from localizing years in output.

This commit is contained in:
caleb logan
2017-08-29 11:56:08 -07:00
committed by Tim Graham
parent 44ce308281
commit 9e2bf65d6a
3 changed files with 65 additions and 1 deletions

View File

@@ -958,7 +958,7 @@ class SelectDateWidget(Widget):
def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
date_context = {}
year_choices = [(i, i) for i in self.years]
year_choices = [(i, str(i)) for i in self.years]
if not self.is_required:
year_choices.insert(0, self.year_none_value)
year_attrs = context['widget']['attrs'].copy()