Fixed DB entry creation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-09-14 02:25:31 +02:00
parent bf18d8e74f
commit bfe2ec8c8c

View File

@ -47,6 +47,12 @@ class CNNView(FlaskView):
# create bucket if necessary # create bucket if necessary
ensure_buckets() ensure_buckets()
# Create the entry in the db
if info['id']:
m = AIModel(id=info['id'], type=AIModelType.CNN)
else:
m = AIModel(type=AIModelType.CNN)
# Put files into MinIO # Put files into MinIO
storage.connection.put_object(current_app.config['MINIO_CNN_BUCKET_NAME'], "model/" + str(m.id), model_file, storage.connection.put_object(current_app.config['MINIO_CNN_BUCKET_NAME'], "model/" + str(m.id), model_file,
model_file.content_length, content_type=model_file.content_type) model_file.content_length, content_type=model_file.content_type)