Skip to content

Commit

Permalink
[MIG] website_require_login: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NICO-SOLUTIONS committed Feb 4, 2025
1 parent d6fcecc commit b1b5e11
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions website_require_login/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Website Login Required
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8dc7356ff523514a2d820a2c3031c271e5ea73de8bd41bb7cb9fdc923b65a792
!! source digest: sha256:a0f16f0655f6b5b9eec2c2e621f35dbcc40c69a3c5353dec8b07ddfab1874313
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -17,13 +17,13 @@ Website Login Required
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/17.0/website_require_login
:target: https://github.com/OCA/website/tree/18.0/website_require_login
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-17-0/website-17-0-website_require_login
:target: https://translation.odoo-community.org/projects/website-18-0/website-18-0-website_require_login
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -51,7 +51,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_require_login%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_require_login%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -83,6 +83,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/website <https://github.com/OCA/website/tree/17.0/website_require_login>`_ project on GitHub.
This module is part of the `OCA/website <https://github.com/OCA/website/tree/18.0/website_require_login>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion website_require_login/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Website Login Required",
"category": "Website",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"author": "Advitus MB, Ooops, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/website",
"license": "LGPL-3",
Expand Down
4 changes: 2 additions & 2 deletions website_require_login/data/ir_actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<record id="action_website_auth_url" model="ir.actions.act_window">
<field name="name">Authorization required URLs</field>
<field name="res_model">website.auth.url</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="website_auth_url_tree_view" />
<field name="view_mode">list</field>
<field name="view_id" ref="website_auth_url_list_view" />
<field name="target">current</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion website_require_login/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def _check_require_auth(cls):
path = request.httprequest.path
for auth_path in auth_paths:
if auth_path == path or Path(auth_path) in Path(path).parents:
redirect_path = "/web/login?redirect=%s" % path
redirect_path = f"/web/login?redirect={path}"
return request.redirect(redirect_path, code=302)
8 changes: 4 additions & 4 deletions website_require_login/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Website Login Required</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8dc7356ff523514a2d820a2c3031c271e5ea73de8bd41bb7cb9fdc923b65a792
!! source digest: sha256:a0f16f0655f6b5b9eec2c2e621f35dbcc40c69a3c5353dec8b07ddfab1874313
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/website/tree/17.0/website_require_login"><img alt="OCA/website" src="https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/website-17-0/website-17-0-website_require_login"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/website&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/website/tree/18.0/website_require_login"><img alt="OCA/website" src="https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/website-18-0/website-18-0-website_require_login"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/website&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to restrict access to specific website pages to
logged users.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -397,7 +397,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/website/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/website/issues/new?body=module:%20website_require_login%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/website/issues/new?body=module:%20website_require_login%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -425,7 +425,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/website/tree/17.0/website_require_login">OCA/website</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/website/tree/18.0/website_require_login">OCA/website</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion website_require_login/tests/test_ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setUpClass(cls):
{"name": "Test User", "login": "test_user", "password": "12345"}
)
cls.path = "/contactus"
cls.expected_path = "/web/login?redirect=%s" % cls.path
cls.expected_path = f"/web/login?redirect={cls.path}"

def test_dispatch_unauthorized(self):
# Test that a public user cannot access "/auth_path
Expand Down
6 changes: 3 additions & 3 deletions website_require_login/views/website_auth_url.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="website_auth_url_tree_view" model="ir.ui.view">
<record id="website_auth_url_list_view" model="ir.ui.view">
<field name="name">website.auth.url</field>
<field name="model">website.auth.url</field>
<field name="arch" type="xml">
<tree editable="bottom">
<list editable="bottom">
<field name="website_id" />
<field name="path" />
</tree>
</list>
</field>
</record>
</odoo>

0 comments on commit b1b5e11

Please sign in to comment.