Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
6f842a10
Commit
6f842a10
authored
4 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary deletes which hare handled by cascade options
parent
22114dd4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models.py
+2
-10
2 additions, 10 deletions
app/models.py
with
2 additions
and
10 deletions
app/models.py
+
2
−
10
View file @
6f842a10
...
...
@@ -241,10 +241,7 @@ class User(UserMixin, db.Model):
'''
Delete the user and its corpora and jobs from database and filesystem.
'''
for
job
in
self
.
jobs
:
job
.
delete
()
for
corpus
in
self
.
corpora
:
corpus
.
delete
()
db
.
session
.
delete
(
self
)
db
.
session
.
commit
()
...
...
@@ -365,10 +362,7 @@ class Job(db.Model):
'''
Delete the job and its inputs and results from the database.
'''
for
input
in
self
.
inputs
:
db
.
session
.
delete
(
input
)
for
result
in
self
.
results
:
db
.
session
.
delete
(
result
)
# TODO: shouldn't this happen through the cascade option?
db
.
session
.
delete
(
self
)
db
.
session
.
commit
()
...
...
@@ -528,8 +522,6 @@ class Corpus(db.Model):
'
files
'
:
{
file
.
id
:
file
.
to_dict
()
for
file
in
self
.
files
}}
def
delete
(
self
):
for
corpus_file
in
self
.
files
:
db
.
session
.
delete
(
corpus_file
)
db
.
session
.
delete
(
self
)
db
.
session
.
commit
()
...
...
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