mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	Fix job result duplication after job restart
This commit is contained in:
		@@ -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'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user