Opened 8 years ago

Closed 8 years ago

#4867 closed (fixed)

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

Reported by: John Shaffer <jshaffer2112@…> Owned by: adrian
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: UI/UX:

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@…> 8 years ago.
check-is_bound.2.diff (679 bytes) - added by John Shaffer <jshaffer2112@…> 8 years ago.
A saner version.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by John Shaffer <jshaffer2112@…>

comment:1 Changed 8 years ago by John Shaffer <jshaffer2112@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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'

Changed 8 years ago by John Shaffer <jshaffer2112@…>

A saner version.

comment:2 Changed 8 years ago by anonymous

Yo eat my dick nigga

comment:3 Changed 8 years ago by jkocherhans

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

(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