Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
eis
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7f60d19d
authored
Jul 12, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Handle potential transaction errors in get_daily_data method by rolling back the…
… session if in transaction
1 parent
44784a36
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
eispajak/views/pcpd.py
eispajak/views/pcpd.py
View file @
7f60d19
...
@@ -155,6 +155,9 @@ class Views(BaseView):
...
@@ -155,6 +155,9 @@ class Views(BaseView):
}
}
def
get_daily_data
(
self
,
table
,
field
,
today
,
filters
,
typ
=
None
):
def
get_daily_data
(
self
,
table
,
field
,
today
,
filters
,
typ
=
None
):
#todo ada kemungkinan menyebabkan error ke transaksi yang lain
if
PCDBSession
.
registry
()
.
in_transaction
():
PCDBSession
.
rollback
()
columns
=
[
field
.
label
(
"step"
)]
columns
=
[
field
.
label
(
"step"
)]
qry
=
table
.
qry_sum
(
columns
)
\
qry
=
table
.
qry_sum
(
columns
)
\
.
group_by
(
field
)
\
.
group_by
(
field
)
\
...
@@ -172,6 +175,8 @@ class Views(BaseView):
...
@@ -172,6 +175,8 @@ class Views(BaseView):
dailyAcc
=
[]
dailyAcc
=
[]
dailyAccTrx
=
[]
dailyAccTrx
=
[]
amt
=
trx
=
acc
=
accTrx
=
0
amt
=
trx
=
acc
=
accTrx
=
0
for
r
in
qry
:
for
r
in
qry
:
mapped
=
r
.
_mapping
mapped
=
r
.
_mapping
step
=
mapped
.
get
(
"step"
,
""
)
step
=
mapped
.
get
(
"step"
,
""
)
...
...
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