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 c970a6cd
authored
Aug 12, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add reg_nip attribute and NIP validation to registration schema
1 parent
86845312
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletions
opensipkd/base/__init__.py
opensipkd/base/tools/api.py
opensipkd/base/views/register.py
opensipkd/base/__init__.py
View file @
c970a6c
...
...
@@ -424,6 +424,7 @@ class BaseApp():
self
.
reg_captcha
=
0
self
.
login_captcha
=
0
self
.
base_dir
=
os
.
path
.
split
(
__file__
)[
0
]
self
.
reg_nip
=
0
def
get_route_file
(
self
,
filename
=
"routes.csv"
):
fullpath
=
os
.
path
.
join
(
self
.
base_dir
,
'scripts'
,
'data'
,
filename
)
...
...
@@ -456,6 +457,7 @@ class BaseApp():
self
.
reg_form
=
get_params
(
"reg_form"
,
'base-register'
)
self
.
reg_id_card
=
get_params
(
"reg_id_card"
,
0
,
settings
=
settings
)
self
.
reg_nip
=
int
(
settings
.
get
(
"reg_nip"
,
0
))
self
.
reg_captcha
=
get_params
(
"reg_captcha"
,
0
,
settings
=
settings
)
self
.
captcha_files
=
os
.
path
.
join
(
self
.
temp_files
,
"captcha"
)
+
os
.
sep
...
...
opensipkd/base/tools/api.py
View file @
c970a6c
...
...
@@ -9,7 +9,7 @@ log = logging.getLogger(__name__)
lima_menit
=
300
#
def
auth_from
(
request
,
field
=
None
):
global
lima_menit
env
=
request
.
environ
...
...
opensipkd/base/views/register.py
View file @
c970a6c
...
...
@@ -124,6 +124,15 @@ class AddSchema(colander.Schema):
title
=
_
(
"ID Card"
),
validator
=
image_validator
)
if
BASE_CLASS
.
reg_nip
:
self
[
"nip"
]
=
colander
.
SchemaNode
(
colander
.
String
(),
title
=
_
(
"NIP"
),
validator
=
colander
.
Length
(
max
=
18
,
min
=
18
),
missing
=
colander
.
drop
,
oid
=
"nip"
)
if
not
request
.
user
and
BASE_CLASS
.
reg_captcha
:
self
[
"captcha"
]
=
colander
.
SchemaNode
(
colander
.
String
(),
...
...
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