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


'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():
-> err = self.errors
-> self.full_clean()
-> self._errors.append(form.errors)
-> self.full_clean()
-> if self.empty_permitted and not self.has_changed():
-> return bool(self.changed_data)
-> if field.widget._has_changed(initial_value, data_value):
-> initial = self.decompress(initial)
-> value = to_current_timezone(value)
-> 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