mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +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
|
||||
users = db.relationship('User', backref='role', lazy='dynamic')
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, include_relationships=True):
|
||||
return {'id': self.id,
|
||||
'default': self.default,
|
||||
'name': self.name,
|
||||
@ -423,6 +423,8 @@ class Job(db.Model):
|
||||
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, 'pyflow.data'), ignore_errors=True) # noqa
|
||||
for result in self.results:
|
||||
db.session.delete(result)
|
||||
self.end_date = None
|
||||
self.status = 'submitted'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user