mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Fix job result duplication after job restart
This commit is contained in:
parent
a5782f932c
commit
280c544297
@ -39,7 +39,7 @@ class Role(db.Model):
|
|||||||
# Relationships
|
# Relationships
|
||||||
users = db.relationship('User', backref='role', lazy='dynamic')
|
users = db.relationship('User', backref='role', lazy='dynamic')
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self, include_relationships=True):
|
||||||
return {'id': self.id,
|
return {'id': self.id,
|
||||||
'default': self.default,
|
'default': self.default,
|
||||||
'name': self.name,
|
'name': self.name,
|
||||||
@ -423,6 +423,8 @@ class Job(db.Model):
|
|||||||
raise Exception('Could not restart job: status is not "complete/failed"') # noqa
|
raise Exception('Could not restart job: status is not "complete/failed"') # noqa
|
||||||
shutil.rmtree(os.path.join(self.path, 'output'), ignore_errors=True)
|
shutil.rmtree(os.path.join(self.path, 'output'), ignore_errors=True)
|
||||||
shutil.rmtree(os.path.join(self.path, 'pyflow.data'), ignore_errors=True) # noqa
|
shutil.rmtree(os.path.join(self.path, 'pyflow.data'), ignore_errors=True) # noqa
|
||||||
|
for result in self.results:
|
||||||
|
db.session.delete(result)
|
||||||
self.end_date = None
|
self.end_date = None
|
||||||
self.status = 'submitted'
|
self.status = 'submitted'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user