incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [13/15] git commit: [#7118] Added check for disabled tracker in GitHub import
Date Mon, 03 Feb 2014 22:53:39 GMT
[#7118] Added check for disabled tracker in GitHub import

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/a92b8e00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a92b8e00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a92b8e00

Branch: refs/heads/cj/7085
Commit: a92b8e00474ad05dd66d1631a70259cdb6449bba
Parents: 1d8f6c8
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Jan 30 23:18:54 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Jan 30 23:18:54 2014 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/__init__.py | 3 +++
 ForgeImporters/forgeimporters/github/tracker.py  | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a92b8e00/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 0f17e0b..434e639 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -173,6 +173,9 @@ class GitHubProjectExtractor(base.ProjectExtractor):
     def has_wiki(self):
         return self.get_page('project_info').get('has_wiki')
 
+    def has_tracker(self):
+        return self.get_page('project_info').get('has_issues')
+
 
 class GitHubOAuthMixin(object):
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a92b8e00/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index fff88f6..4295f2d 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -115,6 +115,9 @@ class GitHubTrackerImporter(ToolImporter):
                     mount_label=None, **kw):
         import_id_converter = ImportIdConverter.get()
         project_name = '%s/%s' % (kw['user_name'], project_name)
+        extractor = GitHubProjectExtractor(project_name, user=user)
+        if not extractor.has_tracker():
+            return
         app = project.install_app('tickets', mount_point, mount_label,
                                   EnableVoting=False,
                                   open_status_names='open',
@@ -127,7 +130,6 @@ class GitHubTrackerImporter(ToolImporter):
         self.github_markdown_converter = GitHubMarkdownConverter(
             kw['user_name'], project_name)
         ThreadLocalORMSession.flush_all()
-        extractor = GitHubProjectExtractor(project_name, user=user)
         try:
             M.session.artifact_orm_session._get().skip_mod_date = True
             with h.push_config(c, user=M.User.anonymous(), app=app):


Mime
View raw message