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 0305227f
authored
Oct 13, 2021
by
irul
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
delete partner user before delete partner itself
1 parent
202f80e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
opensipkd/base/views/partner.py
opensipkd/base/views/partner.py
View file @
0305227
...
...
@@ -17,6 +17,7 @@ from opensipkd.tools.buttons import btn_save, btn_cancel, btn_delete
from
..models
import
DBSession
from
..models
import
Partner
from
..models.partner
import
PartnerUserModel
from
..views
import
ColumnDT
,
DataTables
,
BaseView
SESS_ADD_FAILED
=
'Tambah partner gagal'
...
...
@@ -266,6 +267,10 @@ class ViewPartner(BaseView):
form
=
get_form
(
request
,
EditSchema
,
buttons
=
(
btn_delete
,
btn_cancel
,))
if
request
.
POST
:
if
'delete'
in
request
.
POST
:
partner_user
=
DBSession
.
query
(
PartnerUserModel
)
.
\
filter_by
(
partner_id
=
request
.
matchdict
[
'id'
])
if
partner_user
.
first
():
partner_user
.
delete
()
msg
=
'Partner ID
%
d
%
s sudah dihapus.'
%
(
row
.
id
,
row
.
nama
)
q
.
delete
()
DBSession
.
flush
()
...
...
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