]> git.andy128k.dev Git - ipf.git/commitdiff
check forms are valid in inline formset
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 25 Jun 2013 21:36:43 +0000 (00:36 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 25 Jun 2013 21:36:43 +0000 (00:36 +0300)
ipf/admin/modelinline.php

index ef20ee86a2cf2a0c7e8e854e7c36e5f125e5d234..d1619d6aabaaa05623aac3c804e97c145a1eefa9 100644 (file)
@@ -142,6 +142,9 @@ abstract class IPF_Admin_ModelInline
 
     function save($parent_obj)
     {
+        if (!$this->isValid())
+            throw new IPF_Exception_Form(__('Cannot save models from an invalid formset.'));
+
         if ($this->parentModel->exists()) {
             $objects = IPF_ORM_Query::create()
                 ->from(get_class($this->model))