Support avatar of size 2048

issue10543
review352261002
(grafted from 70b728cf044936ac1d7f6c1f644397dbc9f4e932)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2021-07-07 00:44:40 +02:00
1 parent 32fd647a3f
commit 154ad577f4
1 file changed
+2 -2
+2 -2
View File
@@ -85,7 +85,7 @@ class Avatar(ImageMixin, ResourceMixin, ModelSQL):
2 ** math.ceil(math.log2(size)),
10 * math.ceil(size / 10) if size <= 100
else 50 * math.ceil(size / 50)))
if not (0 < size < 2048):
if not (0 < size <= 2048):
raise ValueError("Invalid size")
for avatar in self.cache:
if avatar.size == size:
@@ -155,7 +155,7 @@ class AvatarCache(ImageMixin, ModelSQL):
"Size", required=True,
domain=[
('size', '>', 0),
('size', '<', 2048),
('size', '<=', 2048),
])
@classmethod