Skip to content

Commit 9fac146

Browse files
committed
[MIG] fastapi_captcha_altcha_backend
1 parent aa2e859 commit 9fac146

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

fastapi_captcha_altcha_backend/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Fastapi Captcha Altcha Backend
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
20-
:target: https://github.com/OCA/rest-framework/tree/16.0/fastapi_captcha_altcha_backend
20+
:target: https://github.com/OCA/rest-framework/tree/18.0/fastapi_captcha_altcha_backend
2121
:alt: OCA/rest-framework
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-fastapi_captcha_altcha_backend
23+
:target: https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-fastapi_captcha_altcha_backend
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=18.0
2727
:alt: Try me on Runboat
2828

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

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

@@ -88,6 +88,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
8888

8989
|maintainer-paradoxxxzero|
9090

91-
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/16.0/fastapi_captcha_altcha_backend>`_ project on GitHub.
91+
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/18.0/fastapi_captcha_altcha_backend>`_ project on GitHub.
9292

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

fastapi_captcha_altcha_backend/__manifest__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
{
66
"name": "Fastapi Captcha Altcha Backend",
7-
"version": "16.0.1.0.0",
7+
"version": "18.0.1.0.0",
88
"author": "Akretion, Odoo Community Association (OCA)",
99
"summary": "Implement Altcha server in FastAPI",
1010
"category": "Tools",
1111
"depends": ["fastapi_captcha"],
1212
"website": "https://github.com/OCA/rest-framework",
1313
"data": [],
1414
"maintainers": ["paradoxxxzero"],
15-
"demo": [],
1615
"installable": True,
1716
"license": "AGPL-3",
1817
"external_dependencies": {

fastapi_captcha_altcha_backend/models/fastapi_endpoint.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @author Florian Mounier <florian.mounier@akretion.com>
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
44

5-
from odoo import _, fields, models
5+
from odoo import fields, models
66
from odoo.exceptions import AccessError, UserError, ValidationError
77

88
try:
@@ -27,7 +27,7 @@ def validate_captcha(self, captcha_response):
2727
secret_key = self.captcha_secret_key
2828
if self.captcha_type == "altcha_local":
2929
if not altcha:
30-
raise UserError(_("Altcha library is not installed."))
30+
raise UserError(self.env._("Altcha library is not installed."))
3131
return self._validate_altcha_local(captcha_response, secret_key)
3232

3333
def _validate_altcha_local(self, captcha_response, secret_key):
@@ -38,11 +38,12 @@ def _validate_altcha_local(self, captcha_response, secret_key):
3838
verified, err = verify_solution(captcha_response, secret_key, True)
3939
if not verified:
4040
raise AccessError(
41-
_("Altcha validation failed: %(error)s") % {"error": err}
41+
self.env._("Altcha validation failed: %(error)s") % {"error": err}
4242
)
4343

4444
return
4545
except Exception as e:
4646
raise ValidationError(
47-
_("Failed to process Altcha payload: %(error)s") % {"error": str(e)}
47+
self.env._("Failed to process Altcha payload: %(error)s")
48+
% {"error": str(e)}
4849
) from e
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"

fastapi_captcha_altcha_backend/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Fastapi Captcha Altcha Backend</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:e97f2c1f5989e99007440eecfb45f75fb664da90312dfd68b8a61d8a321305c1
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/rest-framework/tree/16.0/fastapi_captcha_altcha_backend"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-fastapi_captcha_altcha_backend"><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/rest-framework&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/rest-framework/tree/18.0/fastapi_captcha_altcha_backend"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-fastapi_captcha_altcha_backend"><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/rest-framework&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module adds Altcha service as a FastApi router and add local Altcha
374374
verification as a captcha method.</p>
375375
<p><strong>Table of contents</strong></p>
@@ -397,7 +397,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
397397
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>.
398398
In case of trouble, please check there if your issue has already been reported.
399399
If you spotted it first, help us to smash it by providing a detailed and welcomed
400-
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_captcha_altcha_backend%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
400+
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_captcha_altcha_backend%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
401401
<p>Do not contact contributors directly about support or help with technical issues.</p>
402402
</div>
403403
<div class="section" id="credits">
@@ -425,7 +425,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
425425
promote its widespread use.</p>
426426
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
427427
<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>
428-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/16.0/fastapi_captcha_altcha_backend">OCA/rest-framework</a> project on GitHub.</p>
428+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/18.0/fastapi_captcha_altcha_backend">OCA/rest-framework</a> project on GitHub.</p>
429429
<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>
430430
</div>
431431
</div>

0 commit comments

Comments
 (0)