From 6819f2b0d29a656c61229ee8fd9574486ee3d56a Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Mon, 27 Jun 2022 09:05:37 +0000 Subject: [PATCH] [FIX] base: loading the public user avatar Prior to saas-15.4, access /web/content/res.users/4/image_128 without being logged in, there was an internal server error because you cannot access the public user (id=4) image. The saas-15.4 branch is unaffected by the bug but it is a good idea to forward-port the test that was next to the fix merged in prior versions. Closes #94258 closes odoo/odoo#98201 X-original-commit: 4deb7e373e046844d997ddc0a11999cc12b765d8 Signed-off-by: Julien Castiaux Co-authored-by: ypn --- odoo/addons/test_http/tests/test_static.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/odoo/addons/test_http/tests/test_static.py b/odoo/addons/test_http/tests/test_static.py index c8f31a8e709..39d086e7dbc 100644 --- a/odoo/addons/test_http/tests/test_static.py +++ b/odoo/addons/test_http/tests/test_static.py @@ -263,6 +263,11 @@ class TestHttpStatic(TestHttpStaticCommon): assert_content=self.gizeh_data[100:200] ) + def test_static16_public_user_image(self): + public_user = self.env.ref('base.public_user') + res = self.url_open(f'/web/image/res.users/{public_user.id}/image_128?download=1') + self.assertEqual(res.status_code, 404) + class TestHttpStaticCache(TestHttpStaticCommon): @freeze_time(datetime.utcnow())