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 b03e982b
authored
Feb 06, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan idcard folder
1 parent
8a3a0a6f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
opensipkd/base/__init__.py
opensipkd/base/views/partner.py
opensipkd/base/__init__.py
View file @
b03e982
...
@@ -613,7 +613,7 @@ def get_config(settings):
...
@@ -613,7 +613,7 @@ def get_config(settings):
if
not
os
.
path
.
exists
(
captcha_files
):
if
not
os
.
path
.
exists
(
captcha_files
):
os
.
makedirs
(
captcha_files
)
os
.
makedirs
(
captcha_files
)
if
not
os
.
path
.
exists
(
partner_files
):
if
not
os
.
path
.
exists
(
partner_files
):
os
.
makedirs
(
captcha
_files
)
os
.
makedirs
(
partner
_files
)
config
.
add_static_view
(
'static'
,
'opensipkd.base:static'
,
config
.
add_static_view
(
'static'
,
'opensipkd.base:static'
,
cache_max_age
=
3600
)
cache_max_age
=
3600
)
...
...
opensipkd/base/views/partner.py
View file @
b03e982
...
@@ -279,8 +279,7 @@ class ViewPartner(BaseView):
...
@@ -279,8 +279,7 @@ class ViewPartner(BaseView):
if
"idcard"
in
d
and
d
[
"idcard"
]:
if
"idcard"
in
d
and
d
[
"idcard"
]:
filename
=
d
[
"idcard"
]
filename
=
d
[
"idcard"
]
url
=
self
.
req
.
static_url
(
get_id_card_folder
(
"/"
))
url
=
self
.
req
.
static_url
(
get_id_card_folder
(
"/"
))
preview_url
=
"/"
.
join
(
preview_url
=
"/"
.
join
([
url
,
filename
])
.
replace
(
"//"
,
'/'
)
[
url
,
filename
])
d
[
"idcard"
]
=
{
"uid"
:
filename
.
split
(
"."
)[
0
],
d
[
"idcard"
]
=
{
"uid"
:
filename
.
split
(
"."
)[
0
],
"filename"
:
filename
,
"filename"
:
filename
,
"preview_url"
:
preview_url
"preview_url"
:
preview_url
...
@@ -289,6 +288,8 @@ class ViewPartner(BaseView):
...
@@ -289,6 +288,8 @@ class ViewPartner(BaseView):
def
before_delete
(
self
,
row
):
def
before_delete
(
self
,
row
):
PartnerFiles
.
query
()
.
filter_by
(
partner_id
=
row
.
id
)
.
delete
()
PartnerFiles
.
query
()
.
filter_by
(
partner_id
=
row
.
id
)
.
delete
()
@colander.deferred
@colander.deferred
def
partner_widget
(
node
,
kw
):
def
partner_widget
(
node
,
kw
):
values
=
kw
.
get
(
'partner_list'
,
[])
values
=
kw
.
get
(
'partner_list'
,
[])
...
...
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