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/22 23:53:31 UTC

[05/50] git commit: [#3154] ticket:388 Add not exported tools to notification email

[#3154] ticket:388 Add not exported tools to notification email


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

Branch: refs/heads/master
Commit: cde71c3623e3fe8e2f6403b065bfcaa4caae50fe
Parents: b5f79e6
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jul 5 13:35:34 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Aug 22 20:04:40 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/export_tasks.py           | 7 ++++++-
 Allura/allura/templates/mail/bulk_export.html | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cde71c36/Allura/allura/tasks/export_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/export_tasks.py b/Allura/allura/tasks/export_tasks.py
index d097205..672f51b 100644
--- a/Allura/allura/tasks/export_tasks.py
+++ b/Allura/allura/tasks/export_tasks.py
@@ -41,13 +41,16 @@ def bulk_export(project_shortname, tools, username):
     if project.bulk_export_status() == 'busy':
         log.info('Another export is running for project %s. Skipping.' % project_shortname)
         return
+    not_exported_tools = []
     for tool in tools or []:
         app = project.app_instance(tool)
         if not app:
             log.info('Can not load app for %s mount point. Skipping.' % tool)
+            not_exported_tools.append(tool)
             continue
         if not app.exportable:
             log.info('Tool %s is not exportable. Skipping.' % tool)
+            not_exported_tools.append(tool)
             continue
         log.info('Exporting %s...' % tool)
         try:
@@ -56,6 +59,7 @@ def bulk_export(project_shortname, tools, username):
                 app.bulk_export(f)
         except:
             log.error('Something went wrong during export of %s' % tool, exc_info=True)
+            not_exported_tools.append(tool)
             continue
 
     try:
@@ -73,7 +77,8 @@ def bulk_export(project_shortname, tools, username):
     tmpl_context = {
         'instructions': instructions,
         'project': project,
-        'tools': tools,
+        'tools': list(set(tools) - set(not_exported_tools)),
+        'not_exported_tools': not_exported_tools,
     }
     email = {
         'fromaddr': unicode(user.email_address_header()),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cde71c36/Allura/allura/templates/mail/bulk_export.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/mail/bulk_export.html b/Allura/allura/templates/mail/bulk_export.html
index 420848f..95ade78 100644
--- a/Allura/allura/templates/mail/bulk_export.html
+++ b/Allura/allura/templates/mail/bulk_export.html
@@ -24,6 +24,13 @@ Following tools was exported:
 - {{ tool }}
 {% endfor %}
 
+{% if not_exported_tools %}
+Following tools was not exported:
+{% for tool in not_exported_tools %}
+- {{ tool }}
+{% endfor %}
+{% endif %}
+
 Follow instructions below to get exported data.
 
 {{ instructions }}