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 2021/11/29 16:39:16 UTC
[allura] 01/02: [#8401] removed added test and updated test_project_icon in test_admin
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
commit bd144f3762b028dba3cd2ad2062eb81b44a03e24
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Fri Nov 19 10:58:41 2021 -0700
[#8401] removed added test and updated test_project_icon in test_admin
---
Allura/allura/controllers/project.py | 4 ++++
Allura/allura/tests/functional/test_admin.py | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 3e8a4b4..57133ff 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -250,6 +250,8 @@ class NeighborhoodController(object):
@expose()
def icon(self, w=None, **kw):
try:
+ if isinstance(w, list):
+ w = w[0]
icon = c.project.icon_sized(w=int(w or 48))
except ValueError as e:
log.info('Invalid project icon size: %s on %s', e, request.url)
@@ -422,6 +424,8 @@ class ProjectController(FeedController):
@expose()
def icon(self, w=48, **kw):
try:
+ if isinstance(w, list):
+ w = w[0]
icon = c.project.icon_sized(w=int(w))
except ValueError as e:
log.info('Invalid project icon size: %s on %s', e, request.url)
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index 40a6b84..b69409e 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -390,7 +390,7 @@ class TestProjectAdmin(TestController):
assert image.size == (48, 48)
r = self.app.get('/p/test/icon?foo=bar')
- r = self.app.get('/p/test/icon?w=96')
+ r = self.app.get('/p/test/icon?w=96&w=100&w=10')
image = PIL.Image.open(BytesIO(r.body))
assert image.size == (96, 96)
r = self.app.get('/p/test/icon?w=12345', status=404)