From 6a21060cc561398b6984d13e7abc5363aed07171 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 9 Nov 2015 10:40:54 +0100 Subject: [PATCH] [IMP] review points --- web_favicon/README.rst | 4 +--- web_favicon/controllers/web_favicon.py | 3 ++- web_favicon/tests/test_web_favicon.py | 2 -- web_favicon/views/templates.xml | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/web_favicon/README.rst b/web_favicon/README.rst index 8147340e..7067a91a 100644 --- a/web_favicon/README.rst +++ b/web_favicon/README.rst @@ -25,9 +25,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/{repo_id}/8.0 - -.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt + :target: https://runbot.odoo-community.org/runbot/162/8.0 For further information, please visit: diff --git a/web_favicon/controllers/web_favicon.py b/web_favicon/controllers/web_favicon.py index 1a190d9c..f9212ce4 100644 --- a/web_favicon/controllers/web_favicon.py +++ b/web_favicon/controllers/web_favicon.py @@ -28,10 +28,11 @@ class WebFavicon(http.Controller): @http.route('/web_favicon/favicon', type='http', auth="none") def icon(self): request = http.request - company = request.env['res.company'].search([], limit=1) if 'uid' in request.env.context: user = request.env['res.users'].browse(request.env.context['uid']) company = user.sudo(user.id).company_id + else: + company = request.env['res.company'].search([], limit=1) favicon = company.favicon_backend favicon_mimetype = company.favicon_backend_mimetype if not favicon: diff --git a/web_favicon/tests/test_web_favicon.py b/web_favicon/tests/test_web_favicon.py index c5170f4b..bc56330a 100644 --- a/web_favicon/tests/test_web_favicon.py +++ b/web_favicon/tests/test_web_favicon.py @@ -37,8 +37,6 @@ class FakeResponse(object): self.headers = dict(headers) - - class TestWebFavicon(TransactionCase): def test_web_favicon(self): original_request = http.request diff --git a/web_favicon/views/templates.xml b/web_favicon/views/templates.xml index ebb4cefe..ed80510a 100644 --- a/web_favicon/views/templates.xml +++ b/web_favicon/views/templates.xml @@ -3,7 +3,7 @@