Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20672 closed Bug (needsinfo)

Cannot save InlineFormSet with SplitDateTimeWidget

Reported by: eponymous@… Owned by: nobody
Component: Forms Version: 1.5
Severity: Normal Keywords:
Cc: timograham@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

'unicode' object has no attribute 'tzinfo'

When submitting, value = u'2013-06-28 01:19:49.544351'
However, when loading the page (GET), value = datetime.datetime(2013, 6, 28, 6, 22, 29, 514936, tzinfo=<UTC>)

Call stack:
-> if formset.is_valid():
~/project/lib/django/forms/formsets.py(277)is_valid()
-> err = self.errors
~/project/lib/django/forms/formsets.py(259)errors()
-> self.full_clean()
~/project/lib/django/forms/formsets.py(297)full_clean()
-> self._errors.append(form.errors)
~/project/lib/django/forms/forms.py(117)_get_errors()
-> self.full_clean()
~/project/lib/django/forms/forms.py(270)full_clean()
-> if self.empty_permitted and not self.has_changed():
~/project/lib/django/forms/forms.py(323)has_changed()
-> return bool(self.changed_data)
~/project/lib/django/forms/forms.py(344)_get_changed_data()
-> if field.widget._has_changed(initial_value, data_value):
~/project/lib/django/forms/widgets.py(852)_has_changed()
-> initial = self.decompress(initial)
~/project/lib/django/forms/widgets.py(901)decompress()
-> value = to_current_timezone(value)
~/project/lib/django/forms/util.py(95)to_current_timezone()
-> if settings.USE_TZ and value is not None and timezone.is_aware(value):

Change History (3)

comment:1 Changed 2 years ago by Riley Strong <eponymous@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Type changed from Uncategorized to Bug

comment:2 Changed 2 years ago by timo

  • Resolution set to needsinfo
  • Status changed from new to closed

I tried to reproduce this using an inline in the admin (using both master and 1.5.x), but couldn't. Could you provide steps to reproduce?

comment:3 Changed 2 years ago by timo

  • Cc timograham@… added
Note: See TracTickets for help on using tickets.
Back to Top