You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/08/13 17:55:56 UTC

[2/6] git commit: [#6554] let ProjectConflict be constructed with a single string, like it did before adding Invalid as a parent

[#6554] let ProjectConflict be constructed with a single string, like it did before adding Invalid as a parent


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d43c2544
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d43c2544
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d43c2544

Branch: refs/heads/db/4818
Commit: d43c25447577c512a991b6c70b703fc8438c4cc3
Parents: 9e3e394
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 12 21:34:43 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 12 21:34:43 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/exceptions.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d43c2544/Allura/allura/lib/exceptions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/exceptions.py b/Allura/allura/lib/exceptions.py
index 4c33991..7611dd7 100644
--- a/Allura/allura/lib/exceptions.py
+++ b/Allura/allura/lib/exceptions.py
@@ -18,7 +18,14 @@
 from formencode import Invalid
 
 class ForgeError(Exception): pass
-class ProjectConflict(ForgeError, Invalid): pass
+
+class ProjectConflict(ForgeError, Invalid):
+
+    # support the single string constructor in addition to full set of params that Invalid.__init__ requires
+    def __init__(self, msg, value=None, state=None, error_list=None, error_dict=None):
+        super(ProjectConflict, self).__init__(msg, value, state, error_list, error_dict)
+
+
 class ProjectShortnameInvalid(ForgeError, Invalid): pass
 class ProjectOverlimitError(ForgeError): pass
 class ProjectRatelimitError(ForgeError): pass
@@ -45,4 +52,3 @@ class CompoundError(ForgeError):
                 parts.append('    ' + line)
         parts.append('</%s>\n' % self.__class__.__name__ )
         return ''.join(parts)
-