Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
29f84ea0
Commit
29f84ea0
authored
5 years ago
by
ynerant
Browse files
Options
Downloads
Patches
Plain Diff
Remove test code
parent
49bda926
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!104
Beta
,
!98
Morefront
,
!91
Documents
Pipeline
#8403
passed with warnings with stages
in 5 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/note/models/transactions.py
+0
-8
0 additions, 8 deletions
apps/note/models/transactions.py
apps/permission/models.py
+0
-2
0 additions, 2 deletions
apps/permission/models.py
with
0 additions
and
10 deletions
apps/note/models/transactions.py
+
0
−
8
View file @
29f84ea0
...
...
@@ -218,26 +218,18 @@ class Transaction(PolymorphicModel):
# When source == destination, no money is transferred and no transaction is created
return
self
.
log
(
"
Saving
"
)
# We save first the transaction, in case of the user has no right to transfer money
super
().
save
(
*
args
,
**
kwargs
)
self
.
log
(
"
Saved
"
)
# Save notes
self
.
source
.
refresh_from_db
()
self
.
source
.
balance
+=
diff_source
self
.
source
.
_force_save
=
True
self
.
source
.
save
()
self
.
log
(
"
Source saved
"
)
self
.
destination
.
refresh_from_db
()
self
.
destination
.
balance
+=
diff_dest
self
.
destination
.
_force_save
=
True
self
.
destination
.
save
()
self
.
log
(
"
Destination saved
"
)
def
log
(
self
,
msg
):
with
open
(
"
/tmp/log
"
,
"
a
"
)
as
f
:
f
.
write
(
msg
+
"
\n
"
)
def
delete
(
self
,
**
kwargs
):
"""
...
...
This diff is collapsed.
Click to expand it.
apps/permission/models.py
+
0
−
2
View file @
29f84ea0
...
...
@@ -65,8 +65,6 @@ class InstancedPermission:
obj
.
_force_delete
=
True
Model
.
delete
(
obj
)
with
open
(
"
/tmp/log
"
,
"
w
"
)
as
f
:
f
.
write
(
str
(
obj
)
+
"
,
"
+
str
(
obj
.
pk
)
+
"
,
"
+
str
(
self
.
model
.
model_class
().
objects
.
filter
(
pk
=
0
).
exists
()))
return
ret
if
permission_type
==
self
.
type
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment