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 0ce0601d
authored
Feb 03, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan register captcha
1 parent
dbf16cbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
opensipkd/base/views/register.py
opensipkd/base/views/register.py
View file @
0ce0601
...
...
@@ -31,6 +31,7 @@ from datetime import datetime
import
colander
from
deform
import
(
widget
,
FileData
,
ValidationFailure
)
from
opensipkd.pbb.esppt.tools
import
date_from_str
from
opensipkd.tools
import
Upload
,
mem_tmp_store
,
image_validator
from
opensipkd.tools.buttons
import
btn_cancel
,
btn_register
,
btn_save
from
pyramid.httpexceptions
import
HTTPFound
...
...
@@ -421,10 +422,21 @@ class Registrasi(BaseView):
try
:
c
=
form
.
validate
(
controls
)
except
ValidationFailure
as
e
:
return
dict
(
form
=
form
.
render
(
e
.
cstruct
),
table
=
table
and
table
.
render
()
or
None
,
scripts
=
self
.
form_scripts
,
css
=
resources
[
"css"
],
js
=
resources
[
"js"
])
value
=
self
.
before_add
()
for
f
in
e
.
field
.
children
:
if
isinstance
(
f
.
typ
,
colander
.
Date
):
e
.
cstruct
[
f
.
name
]
=
date_from_str
(
e
.
cstruct
[
f
.
name
])
if
f
.
name
==
"captcha"
:
e
.
cstruct
[
f
.
name
]
=
self
.
get_captcha_url
()
value
.
update
(
e
.
cstruct
)
form
.
set_appstruct
(
e
.
cstruct
)
return
self
.
returned_form
(
form
,
table
,
**
kwargs
)
# return dict(form=form.render(e.cstruct),
# table=table and table.render() or None,
# scripts=self.form_scripts, css=resources["css"],
# js=resources["js"])
values
=
dict
(
c
)
row
=
self
.
save_request
(
values
)
self
.
after_add
(
row
=
row
,
values
=
values
)
...
...
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