Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

newforms-admin: Fixed #4661 - formset forms can give false errors for…

… add_forms. Resetting the forms is still hackish, but this works for now.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5589 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 48fc9e23425fab1ccf97b669050c1de359281ba2 1 parent 7c10d69
Joseph Kocherhans jkocherhans authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/admin/options.py
4 django/contrib/admin/options.py
View
@@ -423,7 +423,7 @@ def add_view(self, request, form_url=''):
for FormSet in self.get_inline_formsets():
inline_formset = FormSet(data=new_data)
inline_formsets.append(inline_formset)
- if form.is_valid() and all_valid(inline_formsets):
+ if all_valid(inline_formsets) and form.is_valid():
return self.save_add(request, model, form, inline_formsets, '../%s/')
else:
form = ModelForm(initial=request.GET)
@@ -477,7 +477,7 @@ def change_view(self, request, object_id):
inline_formset = FormSet(obj, new_data)
inline_formsets.append(inline_formset)
- if form.is_valid() and all_valid(inline_formsets):
+ if all_valid(inline_formsets) and form.is_valid():
return self.save_change(request, model, form, inline_formsets)
else:
form = ModelForm()
Please sign in to comment.
Something went wrong with that request. Please try again.