Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d3981fcf
authored
Oct 21, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Improve error handling in CaptchaWidget by logging session details when captcha is not found
1 parent
f34bd454
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
opensipkd/base/widgets/widget_os.py
opensipkd/base/widgets/widget_os.py
View file @
d3981fc
...
@@ -406,11 +406,14 @@ class CaptchaWidget(Widget):
...
@@ -406,11 +406,14 @@ class CaptchaWidget(Widget):
_logging
.
error
(
f
"Captcha tidak sesuai: {pstruct} != {captcha_session}"
)
_logging
.
error
(
f
"Captcha tidak sesuai: {pstruct} != {captcha_session}"
)
raise
Invalid
(
field
.
schema
,
captcha_message
)
raise
Invalid
(
field
.
schema
,
captcha_message
)
else
:
else
:
captcha_file
=
os
.
path
.
join
(
settings
[
'captcha_files'
],
f
"{pstruct}.png"
)
# captcha_file = os.path.join(settings['captcha_files'], f"{pstruct}.png")
captcha_exists
=
os
.
path
.
exists
(
captcha_file
)
# captcha_exists = os.path.exists(captcha_file)
if
not
captcha_exists
:
# if not captcha_exists:
_logging
.
error
(
f
"Captcha file not found: {captcha_file}"
)
# _logging.error(f"Captcha file not found: {captcha_file}")
raise
Invalid
(
field
.
schema
,
captcha_message
)
_logging
.
error
(
f
"Captcha session not found for input: {pstruct}"
)
_logging
.
error
(
self
.
request
.
session
.
items
())
raise
Invalid
(
field
.
schema
,
captcha_message
)
return
pstruct
return
pstruct
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment