Skip to content
Snippets Groups Projects
Commit 352a4939 authored by Shirlei Aparecida de Chaves's avatar Shirlei Aparecida de Chaves Committed by Ben Adida
Browse files

Remove numbering fields

Fields are not named with numbers. For instance, is voting_ends_at and
not voting_ends_at_1. This was causing values not being saved.
parent bdd916fb
No related branches found
No related tags found
No related merge requests found
......@@ -179,7 +179,7 @@ class SplitSelectDateTimeWidget(MultiWidget):
# See https://stackoverflow.com/questions/4324676/django-multiwidget-subclass-not-calling-decompress
def value_from_datadict(self, data, files, name):
if data.get(name, None) is None:
return [widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)]
return [widget.value_from_datadict(data, files, name ) for widget in self.widgets]
return self.decompress(data.get(name, None))
def decompress(self, value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment