mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 17:25:44 +00:00
14 lines
431 B
Python
14 lines
431 B
Python
|
from .. import db
|
||
|
from ..decorators import background
|
||
|
from ..models import QueryResult
|
||
|
|
||
|
|
||
|
@background
|
||
|
def delete_query_result(query_result_id, *args, **kwargs):
|
||
|
with kwargs['app'].app_context():
|
||
|
query_result = QueryResult.query.get(query_result_id)
|
||
|
if query_result is None:
|
||
|
raise Exception('QueryResult {} not found'.format(query_result_id))
|
||
|
query_result.delete()
|
||
|
db.session.commit()
|