Fixed critical error in Fingerprint where upload was not committed.
This commit is contained in:
parent
5ff11d9c6b
commit
399d0c88f2
@ -2,18 +2,22 @@ import csv
|
||||
import datetime
|
||||
from io import StringIO
|
||||
from pyramid.view import view_config
|
||||
import transaction
|
||||
from brewman.models import DBSession
|
||||
from brewman.models.validation_exception import TryCatchFunction
|
||||
from brewman.models.voucher import Fingerprint
|
||||
|
||||
__author__ = 'tanshu'
|
||||
|
||||
@view_config(request_method='POST', route_name='api_fingerprint', renderer='json', permission='Authenticated')
|
||||
@TryCatchFunction
|
||||
def show_list(request):
|
||||
filename = request.POST['uploadedFile'].filename
|
||||
input_file = request.POST['uploadedFile'].file
|
||||
reader = csv.reader(read_file(input_file), delimiter=";")
|
||||
for row in reader:
|
||||
add_fingerprint(row)
|
||||
transaction.commit()
|
||||
return filename
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user