Opened 17 years ago

Closed 17 years ago

#4867 closed (fixed)

[newforms-admin] FormSet.is_valid() throws error on unbound forms

Reported by: John Shaffer <jshaffer2112@…> Owned by: Adrian Holovaty
Component: Forms Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It should behave like an unbound Form, and return False if self.is_bound is False.

Attachments (2)

check-is_bound.diff (658 bytes ) - added by John Shaffer <jshaffer2112@…> 17 years ago.
check-is_bound.2.diff (679 bytes ) - added by John Shaffer <jshaffer2112@…> 17 years ago.
A saner version.

Download all attachments as: .zip

Change History (5)

by John Shaffer <jshaffer2112@…>, 17 years ago

Attachment: check-is_bound.diff added

comment:1 by John Shaffer <jshaffer2112@…>, 17 years ago

The traceback, in case you want it:

Traceback (most recent call last):
File "C:\Documents and Settings\John\My Documents\django-trunk\django\core\handlers\base.py" in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Documents and Settings\John\My Documents\django-trunk\django\contrib\auth\decorators.py" in _checklogin
  17. return view_func(request, *args, **kwargs)
File "C:\Documents and Settings\John\My Documents\django-trunk\django\db\transaction.py" in _commit_on_success
  194. res = func(*args, **kw)
File "C:\Documents and Settings\John\My Documents\booking\views\add_appointments.py" in index
  59. if formset.is_valid() and formset.cleaned_data:
File "C:\Documents and Settings\John\My Documents\booking\formsets.py" in is_valid
  150. return self._is_valid

  AttributeError at /booking/add-appointments/
  'AppointmentFormFormSet' object has no attribute '_is_valid'

by John Shaffer <jshaffer2112@…>, 17 years ago

Attachment: check-is_bound.2.diff added

A saner version.

comment:2 by anonymous, 17 years ago

Yo eat my dick nigga

comment:3 by jkocherhans, 17 years ago

Resolution: fixed
Status: newclosed

(In [6052]) Fixed #4867. FormSet.is_valid() now returns False when the FormSet is not bound. Thanks John Shaffer.

Note: See TracTickets for help on using tickets.
Back to Top