This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch db/py3_icon_upload
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/db/py3_icon_upload by this
push:
new c690455 Avoid error on incorrect url
c690455 is described below
commit c690455e8237a37e84b047c0c002f674ab0c8673
Author: Dave Brondsema <[email protected]>
AuthorDate: Thu Mar 11 10:47:11 2021 -0500
Avoid error on incorrect url
---
Allura/allura/controllers/project.py | 5 ++++-
Allura/allura/tests/functional/test_neighborhood.py | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Allura/allura/controllers/project.py
b/Allura/allura/controllers/project.py
index 1afd0e7..0260d7b 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -1019,7 +1019,10 @@ class ProjectImporterController(object):
self.neighborhood = neighborhood
@expose()
- def _lookup(self, source, *rest):
+ def _lookup(self, source=None, *rest):
+ if source is None:
+ raise exc.HTTPNotFound
+
# iter_entry_points is a generator with 0 or 1 items, so a loop is the
easiest way to handle
for ep in iter_entry_points('allura.project_importers', source):
return ep.load()(self.neighborhood), rest
diff --git a/Allura/allura/tests/functional/test_neighborhood.py
b/Allura/allura/tests/functional/test_neighborhood.py
index bd69d8e..128afba 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -1107,5 +1107,6 @@ class TestProjectImport(TestController):
def test_not_found(self):
self.app.get('/p/import_project/asdf/', status=404)
+ self.app.get('/p/import_project/', status=404)
# positive tests exist within ForgeImporter package