mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 09:15:41 +00:00
14 lines
419 B
Python
14 lines
419 B
Python
from .. import db
|
|
from ..decorators import background
|
|
from ..models import Result
|
|
|
|
|
|
@background
|
|
def delete_result(result_id, *args, **kwargs):
|
|
with kwargs['app'].app_context():
|
|
result = Result.query.get(result_id)
|
|
if result is None:
|
|
raise Exception('Result {} not found'.format(result_id))
|
|
result.delete() # cascades down and also deletes ResultFile
|
|
db.session.commit()
|