So we call the actual intended validation method rather
than the django one, that could return None, and then
raise a non intended exception during the validation
process.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 frontend/afe/model_logic.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/frontend/afe/model_logic.py b/frontend/afe/model_logic.py
index 38bcabe..9f13e67 100644
--- a/frontend/afe/model_logic.py
+++ b/frontend/afe/model_logic.py
@@ -694,7 +694,7 @@ class ModelExtensions(object):
         return data
 
 
-    def validate_unique(self):
+    def _validate_unique(self):
         """\
         Validate that unique fields are unique.  Django manipulators do
         this too, but they're a huge pain to use manually.  Trust me.
@@ -755,7 +755,7 @@ class ModelExtensions(object):
 
     def do_validate(self):
         errors = self._validate()
-        unique_errors = self.validate_unique()
+        unique_errors = self._validate_unique()
         for field_name, error in unique_errors.iteritems():
             errors.setdefault(field_name, error)
         if errors:
-- 
1.7.5.2

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to