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 a9962275
authored
Feb 06, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan partner
1 parent
0ef5440c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
opensipkd/base/views/partner.py
opensipkd/base/views/partner.py
View file @
a996227
...
@@ -237,6 +237,15 @@ class ViewPartner(BaseView):
...
@@ -237,6 +237,15 @@ class ViewPartner(BaseView):
err_kode
()
err_kode
()
elif
found
:
elif
found
:
err_kode
()
err_kode
()
if
"idcard"
in
value
and
value
[
"idcard"
]:
idcard
=
value
[
"idcard"
]
if
"fp"
in
idcard
and
idcard
[
"fp"
]
and
idcard
[
"fp"
]
!=
b
''
:
path
=
get_id_card_folder
()
upload
=
Upload
(
path
)
value
[
"idcard"
]
=
upload
.
save_fp
(
idcard
)
else
:
value
.
pop
(
"idcard"
)
value
[
'is_vendor'
]
=
'is_vendor'
in
value
and
\
value
[
'is_vendor'
]
=
'is_vendor'
in
value
and
\
value
[
'is_vendor'
]
and
1
or
0
value
[
'is_vendor'
]
and
1
or
0
...
@@ -264,14 +273,14 @@ class ViewPartner(BaseView):
...
@@ -264,14 +273,14 @@ class ViewPartner(BaseView):
return
result
return
result
def
save_request
(
self
,
values
,
row
=
None
):
def
save_request
(
self
,
values
,
row
=
None
):
if
"idcard"
in
values
and
values
[
"idcard"
]:
#
if "idcard" in values and values["idcard"]:
if
str
(
self
.
req
.
POST
[
'upload'
])
!=
""
:
#
if str(self.req.POST['upload']) != "":
folder
=
self
.
get_params
(
"idcard_folder"
,
'/tmp/idcard'
)
#
folder = self.get_params("idcard_folder", '/tmp/idcard')
upload
=
Upload
(
folder
)
#
upload = Upload(folder)
file_name
=
upload
.
save
(
self
.
req
,
'upload'
,
img_exts
)
#
file_name = upload.save(self.req, 'upload', img_exts)
values
[
"idcard"
]
=
file_name
#
values["idcard"] = file_name
else
:
#
else:
del
values
[
"idcard"
]
#
del values["idcard"]
row
=
super
()
.
save_request
(
values
,
row
)
row
=
super
()
.
save_request
(
values
,
row
)
return
row
return
row
...
...
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