Skip to content

Commit 050d9dd

Browse files
imbarbudimanparadoxxxzero
authored andcommitted
[FIX][16.0] auth_partner: check if auth_partner.exists()
browse() will return a pseudo-record. Use browse().exists() to ensure the record exists.
1 parent 5887934 commit 050d9dd

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

auth_partner/README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
104104
mission is to support the collaborative development of Odoo features and
105105
promote its widespread use.
106106

107+
.. |maintainer-paradoxxxzero| image:: https://github.com/paradoxxxzero.png?size=40px
108+
:target: https://github.com/paradoxxxzero
109+
:alt: paradoxxxzero
110+
111+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
112+
113+
|maintainer-paradoxxxzero|
114+
107115
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/18.0/auth_partner>`_ project on GitHub.
108116

109117
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

auth_partner/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"demo/auth_directory_demo.xml",
3232
"demo/auth_partner_demo.xml",
3333
],
34+
"maintainers": ["paradoxxxzero"],
3435
"external_dependencies": {
3536
"python": ["itsdangerous", "pyjwt"],
3637
},

auth_partner/models/auth_directory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _decode_token(
199199

200200
if (
201201
obj["action"] != action
202-
or not auth_partner
202+
or not auth_partner.exists()
203203
or auth_partner.directory_id != self
204204
):
205205
raise UserError(self.env._("Invalid token"))

auth_partner/static/description/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
446446
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
447447
mission is to support the collaborative development of Odoo features and
448448
promote its widespread use.</p>
449+
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
450+
<p><a class="reference external image-reference" href="https://github.com/paradoxxxzero"><img alt="paradoxxxzero" src="https://github.com/paradoxxxzero.png?size=40px" /></a></p>
449451
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/18.0/auth_partner">OCA/rest-framework</a> project on GitHub.</p>
450452
<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>
451453
</div>

0 commit comments

Comments
 (0)