diff --git a/addons/test_website/controllers/main.py b/addons/test_website/controllers/main.py index 6b4328287e0..b95dfddd2a1 100644 --- a/addons/test_website/controllers/main.py +++ b/addons/test_website/controllers/main.py @@ -16,90 +16,90 @@ class WebsiteTest(Home): def test_view(self, **kwargs): return request.render('test_website.test_view') - @http.route('/ignore_args/converteronly//', type='http', auth="public", website=True) + @http.route('/ignore_args/converteronly//', type='http', auth="public", website=True, sitemap=False) def test_ignore_args_converter_only(self, a): return request.make_response(json.dumps(dict(a=a, kw=None))) - @http.route('/ignore_args/none', type='http', auth="public", website=True) + @http.route('/ignore_args/none', type='http', auth="public", website=True, sitemap=False) def test_ignore_args_none(self): return request.make_response(json.dumps(dict(a=None, kw=None))) - @http.route('/ignore_args/a', type='http', auth="public", website=True) + @http.route('/ignore_args/a', type='http', auth="public", website=True, sitemap=False) def test_ignore_args_a(self, a): return request.make_response(json.dumps(dict(a=a, kw=None))) - @http.route('/ignore_args/kw', type='http', auth="public", website=True) + @http.route('/ignore_args/kw', type='http', auth="public", website=True, sitemap=False) def test_ignore_args_kw(self, a, **kw): return request.make_response(json.dumps(dict(a=a, kw=kw))) - @http.route('/ignore_args/converter//', type='http', auth="public", website=True) + @http.route('/ignore_args/converter//', type='http', auth="public", website=True, sitemap=False) def test_ignore_args_converter(self, a, b='youhou', **kw): return request.make_response(json.dumps(dict(a=a, b=b, kw=kw))) - @http.route('/ignore_args/converter//nokw', type='http', auth="public", website=True) + @http.route('/ignore_args/converter//nokw', type='http', auth="public", website=True, sitemap=False) def test_ignore_args_converter_nokw(self, a, b='youhou'): return request.make_response(json.dumps(dict(a=a, b=b))) - @http.route('/multi_company_website', type='http', auth="public", website=True) + @http.route('/multi_company_website', type='http', auth="public", website=True, sitemap=False) def test_company_context(self): return request.make_response(json.dumps(request.context.get('allowed_company_ids'))) # Test Session - @http.route('/test_get_dbname', type='json', auth='public', website=True) + @http.route('/test_get_dbname', type='json', auth='public', website=True, sitemap=False) def test_get_dbname(self, **kwargs): return request.env.cr.dbname # Test Error - @http.route('/test_error_view', type='http', auth='public', website=True) + @http.route('/test_error_view', type='http', auth='public', website=True, sitemap=False) def test_error_view(self, **kwargs): return request.render('test_website.test_error_view') - @http.route('/test_user_error_http', type='http', auth='public', website=True) + @http.route('/test_user_error_http', type='http', auth='public', website=True, sitemap=False) def test_user_error_http(self, **kwargs): raise UserError("This is a user http test") - @http.route('/test_user_error_json', type='json', auth='public', website=True) + @http.route('/test_user_error_json', type='json', auth='public', website=True, sitemap=False) def test_user_error_json(self, **kwargs): raise UserError("This is a user rpc test") - @http.route('/test_validation_error_http', type='http', auth='public', website=True) + @http.route('/test_validation_error_http', type='http', auth='public', website=True, sitemap=False) def test_validation_error_http(self, **kwargs): raise ValidationError("This is a validation http test") - @http.route('/test_validation_error_json', type='json', auth='public', website=True) + @http.route('/test_validation_error_json', type='json', auth='public', website=True, sitemap=False) def test_validation_error_json(self, **kwargs): raise ValidationError("This is a validation rpc test") - @http.route('/test_access_error_json', type='json', auth='public', website=True) + @http.route('/test_access_error_json', type='json', auth='public', website=True, sitemap=False) def test_access_error_json(self, **kwargs): raise AccessError("This is an access rpc test") - @http.route('/test_access_error_http', type='http', auth='public', website=True) + @http.route('/test_access_error_http', type='http', auth='public', website=True, sitemap=False) def test_access_error_http(self, **kwargs): raise AccessError("This is an access http test") - @http.route('/test_missing_error_json', type='json', auth='public', website=True) + @http.route('/test_missing_error_json', type='json', auth='public', website=True, sitemap=False) def test_missing_error_json(self, **kwargs): raise MissingError("This is a missing rpc test") - @http.route('/test_missing_error_http', type='http', auth='public', website=True) + @http.route('/test_missing_error_http', type='http', auth='public', website=True, sitemap=False) def test_missing_error_http(self, **kwargs): raise MissingError("This is a missing http test") - @http.route('/test_internal_error_json', type='json', auth='public', website=True) + @http.route('/test_internal_error_json', type='json', auth='public', website=True, sitemap=False) def test_internal_error_json(self, **kwargs): raise werkzeug.exceptions.InternalServerError() - @http.route('/test_internal_error_http', type='http', auth='public', website=True) + @http.route('/test_internal_error_http', type='http', auth='public', website=True, sitemap=False) def test_internal_error_http(self, **kwargs): raise werkzeug.exceptions.InternalServerError() - @http.route('/test_access_denied_json', type='json', auth='public', website=True) + @http.route('/test_access_denied_json', type='json', auth='public', website=True, sitemap=False) def test_denied_error_json(self, **kwargs): raise AccessDenied("This is an access denied rpc test") - @http.route('/test_access_denied_http', type='http', auth='public', website=True) + @http.route('/test_access_denied_http', type='http', auth='public', website=True, sitemap=False) def test_denied_error_http(self, **kwargs): raise AccessDenied("This is an access denied http test") diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 145ca54a268..24451c90e89 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -871,7 +871,7 @@ class Home(http.Controller): def _login_redirect(self, uid, redirect=None): return redirect if redirect else '/web' - @http.route('/web/login', type='http', auth="none", sitemap=False) + @http.route('/web/login', type='http', auth="none") def web_login(self, redirect=None, **kw): ensure_db() request.params['login_success'] = False diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 05340e07ca2..32bee3fb203 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -92,7 +92,7 @@ class Website(Home): # while portal users are redirected to the frontend by default # ------------------------------------------------------ - @http.route(website=True, auth="public") + @http.route(website=True, auth="public", sitemap=False) def web_login(self, redirect=None, *args, **kw): response = super(Website, self).web_login(redirect=redirect, *args, **kw) if not redirect and request.params['login_success']: @@ -129,7 +129,7 @@ class Website(Home): def robots(self, **kwargs): return request.render('website.robots', {'url_root': request.httprequest.url_root}, mimetype='text/plain') - @http.route('/sitemap.xml', type='http', auth="public", website=True, multilang=False) + @http.route('/sitemap.xml', type='http', auth="public", website=True, multilang=False, sitemap=False) def sitemap_xml_index(self, **kwargs): current_website = request.website Attachment = request.env['ir.attachment'].sudo() diff --git a/addons/website/models/website.py b/addons/website/models/website.py index aff02a21882..73e4e657b56 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -749,8 +749,6 @@ class Website(models.Model): domain_part, url = rule.build(value, append_unknown=False) if not query_string or query_string.lower() in url.lower(): page = {'loc': url} - if url in ('/sitemap.xml',): - continue if url in url_set: continue url_set.add(url)