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: [#6704] ticket:454 s/required/not_empty/ for validator
Date Thu, 24 Oct 2013 20:31:54 GMT
Updated Branches:
  refs/heads/master f70c6b9dd -> 73aef0a39


[#6704] ticket:454 s/required/not_empty/ for validator


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

Branch: refs/heads/master
Commit: 73aef0a3943a6b64df3f60bc7a7eb8893d84028b
Parents: 55c5fe4
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Oct 22 13:03:17 2013 +0300
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Oct 24 20:30:09 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/forge/tracker.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/73aef0a3/ForgeImporters/forgeimporters/forge/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/forge/tracker.py b/ForgeImporters/forgeimporters/forge/tracker.py
index d9154bc..a9a17bb 100644
--- a/ForgeImporters/forgeimporters/forge/tracker.py
+++ b/ForgeImporters/forgeimporters/forge/tracker.py
@@ -53,7 +53,7 @@ from forgeimporters.base import (
 
 
 class ForgeTrackerImportForm(ToolImportForm):
-    tickets_json = v.JsonFile(required=True)
+    tickets_json = v.JsonFile(not_empty=True)
 
 
 class ForgeTrackerImportController(BaseController):
@@ -76,11 +76,7 @@ class ForgeTrackerImportController(BaseController):
     @validate(ForgeTrackerImportForm(ForgeTrackerApp), error_handler=index)
     def create(self, tickets_json, mount_point, mount_label, **kw):
         if self.importer.enforce_limit(c.project):
-            if not tickets_json:
-                flash('No file specified.', 'error')
-                redirect(c.project.url() + 'admin/')
-            else:
-                save_importer_upload(c.project, 'tickets.json', json.dumps(tickets_json))
+            save_importer_upload(c.project, 'tickets.json', json.dumps(tickets_json))
             self.importer.post(
                     mount_point=mount_point,
                     mount_label=mount_label,


Mime
View raw message