|
@@ -1,7 +1,6 @@
|
|
|
from flask import request, abort, jsonify
|
|
|
from flask.views import View
|
|
|
|
|
|
-from pycs import db
|
|
|
from pycs.database.File import File
|
|
|
from pycs.database.Result import Result
|
|
|
from pycs.frontend.notifications.NotificationManager import NotificationManager
|
|
@@ -49,13 +48,12 @@ class CreateResult(View):
|
|
|
|
|
|
|
|
|
removed = []
|
|
|
- # start transaction
|
|
|
- with db.session.begin_nested():
|
|
|
- # find full-image labels and remove them
|
|
|
- results = file.results.filter_by(type='labeled-image')
|
|
|
- for result in results.all():
|
|
|
- removed.append(result.serialize())
|
|
|
- results.delete()
|
|
|
+
|
|
|
+ # find full-image labels and remove them
|
|
|
+ results = file.results.filter_by(type='labeled-image')
|
|
|
+ for result in results.all():
|
|
|
+ removed.append(result.serialize())
|
|
|
+ results.delete()
|
|
|
|
|
|
# insert into database
|
|
|
new_result = file.create_result('user', rtype, label, data)
|