diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 9dfdb8b..fd6e719 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
411 | 411 | for inline in self.inline_instances: |
412 | 412 | yield inline.get_formset(request, obj) |
413 | 413 | |
| 414 | def formsets_are_valid(self, formsets, form, form_validated, new_object, |
| 415 | request): |
| 416 | "Hook for doing combined form/formset validation." |
| 417 | return all_valid(formsets) |
| 418 | |
414 | 419 | def log_addition(self, request, object): |
415 | 420 | """ |
416 | 421 | Log that an object has been successfully added. |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
785 | 790 | save_as_new=request.POST.has_key("_saveasnew"), |
786 | 791 | prefix=prefix, queryset=inline.queryset(request)) |
787 | 792 | formsets.append(formset) |
788 | | if all_valid(formsets) and form_validated: |
| 793 | if self.formsets_are_valid(formsets, form, form_validated, |
| 794 | new_object, request) and form_validated: |
789 | 795 | self.save_model(request, new_object, form, change=False) |
790 | 796 | form.save_m2m() |
791 | 797 | for formset in formsets: |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
885 | 891 | |
886 | 892 | formsets.append(formset) |
887 | 893 | |
888 | | if all_valid(formsets) and form_validated: |
| 894 | if self.formsets_are_valid(formsets, form, form_validated, |
| 895 | new_object, request) and form_validated: |
889 | 896 | self.save_model(request, new_object, form, change=True) |
890 | 897 | form.save_m2m() |
891 | 898 | for formset in formsets: |