Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3202f892
authored
Aug 06, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan register
1 parent
20c336b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
opensipkd/base/security.py
opensipkd/base/views/base_views.py
opensipkd/base/views/register.py
opensipkd/base/security.py
View file @
3202f89
...
@@ -13,7 +13,7 @@ def group_finder(user_id, request):
...
@@ -13,7 +13,7 @@ def group_finder(user_id, request):
user
=
None
user
=
None
if
not
user
or
not
user
.
status
:
if
not
user
or
not
user
.
status
:
log
.
info
(
"User tidak ditemukan
"
)
log
.
debug
(
f
"user_id {user_id} not found or archived
"
)
return
[]
return
[]
r
=
[]
r
=
[]
...
...
opensipkd/base/views/base_views.py
View file @
3202f89
...
@@ -436,7 +436,7 @@ class BaseView(object):
...
@@ -436,7 +436,7 @@ class BaseView(object):
self
.
table
.
company_id
==
self
.
req
.
user
.
company_id
)
self
.
table
.
company_id
==
self
.
req
.
user
.
company_id
)
return
query
return
query
def
next_add
(
self
,
form
):
def
next_add
(
self
,
form
,
**
kwargs
):
"""
"""
Digunakan untuk memverifikasi button yang lainnya
Digunakan untuk memverifikasi button yang lainnya
:param form: Object Form
:param form: Object Form
...
...
opensipkd/base/views/register.py
View file @
3202f89
...
@@ -29,7 +29,7 @@ Link dalam module registrasi:
...
@@ -29,7 +29,7 @@ Link dalam module registrasi:
import
os
import
os
import
colander
import
colander
from
deform
import
(
widget
,
Button
,
FileData
)
from
deform
import
(
widget
,
Button
,
FileData
,
ValidationFailure
)
from
pyramid.threadlocal
import
get_current_registry
from
pyramid.threadlocal
import
get_current_registry
from
opensipkd.tools
import
Upload
,
mem_tmp_store
,
image_validator
from
opensipkd.tools
import
Upload
,
mem_tmp_store
,
image_validator
...
@@ -441,3 +441,20 @@ class Registrasi(BaseView):
...
@@ -441,3 +441,20 @@ class Registrasi(BaseView):
DBSession
.
flush
()
DBSession
.
flush
()
self
.
req
.
session
.
flash
(
"Sukses update profile"
)
self
.
req
.
session
.
flash
(
"Sukses update profile"
)
return
row
return
row
def
next_add
(
self
,
form
,
**
kwargs
):
table
=
kwargs
.
get
(
"table"
)
resources
=
kwargs
.
get
(
"resources"
)
if
'register'
in
self
.
req
.
POST
:
controls
=
self
.
req
.
POST
.
items
()
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"
])
values
=
dict
(
c
)
row
=
self
.
save_request
(
values
)
self
.
after_add
(
row
,
values
)
return
self
.
route_list
()
\ No newline at end of file
\ No newline at end of file
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