incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/2] git commit: [#7118] Fixed validation error handling on GitHub project importer
Date Tue, 04 Feb 2014 20:49:15 GMT
Updated Branches:
  refs/heads/master bfee3bc78 -> 9d3746113


[#7118] Fixed validation error handling on GitHub project importer

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/master
Commit: e3962915951ba0f58d48f6d9571871365a489c48
Parents: bfee3bc
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Tue Feb 4 20:48:31 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Tue Feb 4 20:48:31 2014 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/base.py           | 5 ++---
 ForgeImporters/forgeimporters/github/project.py | 6 +-----
 2 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e3962915/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index 848cb38..32f2ef3 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -305,10 +305,9 @@ class ProjectImporter(BaseController):
             redirect('.')
 
         self.after_project_create(c.project, **kw)
-        if isinstance(kw['tools'], basestring):
-            kw['tools'] = [kw['tools'], ]
+        tools = aslist(kw.get('tools'))
 
-        for importer_name in kw['tools']:
+        for importer_name in tools:
             ToolImporter.by_name(importer_name).post(**kw)
         M.AuditLog.log('import project from %s' % self.source)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e3962915/ForgeImporters/forgeimporters/github/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/project.py b/ForgeImporters/forgeimporters/github/project.py
index 003adae..c4d8c61 100644
--- a/ForgeImporters/forgeimporters/github/project.py
+++ b/ForgeImporters/forgeimporters/github/project.py
@@ -17,8 +17,6 @@
 
 import logging
 
-from formencode import validators as fev
-
 from tg import expose, validate
 from tg.decorators import with_trailing_slash
 
@@ -58,10 +56,8 @@ class GitHubProjectImporter(base.ProjectImporter, GitHubOAuthMixin):
 
     @require_post()
     @expose()
-    @validate(process_validator)
+    @validate(process_validator, error_handler=index)
     def process(self, **kw):
-        if not type(kw['tools']) == list:
-            kw['tools'] = [kw['tools']]
         return super(self.__class__, self).process(**kw)
 
     @expose('json:')


Mime
View raw message