Commit 7b94069a authored by Oleg Borisenko's avatar Oleg Borisenko
Browse files

Small bugfix

parent 3974137f
......@@ -41,14 +41,14 @@ def copy_status(request):
copied_wgs = request.dbsession.query(func.sum(models.FileToBackup.fsize).cast(BIGINT)).filter(
and_(models.FileToBackup.is_file == True,
models.FileToBackup.kind == models.DataKind.wgs,
models.FileToBackup.tape_label != None)).scalar()
models.FileToBackup.tape_label != None)).scalar() or 0
copied_wgs_archived = request.dbsession.query(func.sum(models.FileToBackup.fsize).cast(BIGINT)).filter(
and_(models.FileToBackup.is_file == True,
models.FileToBackup.kind == models.DataKind.wgs,
models.FileToBackup.tape_label != None)).\
join(models.Tape, models.FileToBackup.tape_label == models.Tape.label).filter(
models.Tape.location != "Inside tape library"
).scalar()
).scalar() or 0
copied_wgs_inside = request.dbsession.query(func.sum(models.FileToBackup.fsize).cast(BIGINT)).filter(
and_(models.FileToBackup.is_file == True,
......@@ -56,25 +56,25 @@ def copy_status(request):
models.FileToBackup.tape_label != None)).\
join(models.Tape, models.FileToBackup.tape_label == models.Tape.label).filter(
models.Tape.location == "Inside tape library"
).scalar()
).scalar() or 0
copied_labnums_archived = request.dbsession.query(func.count(distinct(models.FileToBackup.labnum))).filter(
models.FileToBackup.tape_label != None). \
filter(models.FileToBackup.kind == models.DataKind.wgs). \
join(models.Tape, models.FileToBackup.tape_label == models.Tape.label).filter(
models.Tape.location != "Inside tape library"
).scalar()
).scalar() or 0
copied_labnums_inside = request.dbsession.query(func.count(distinct(models.FileToBackup.labnum))).filter(
models.FileToBackup.tape_label != None). \
filter(models.FileToBackup.kind == models.DataKind.wgs).\
join(models.Tape, models.FileToBackup.tape_label == models.Tape.label).filter(
models.Tape.location == "Inside tape library"
).scalar()
).scalar() or 0
copied_labnums = request.dbsession.query(func.count(distinct(models.FileToBackup.labnum))).filter(
models.FileToBackup.tape_label != None).\
filter(models.FileToBackup.kind == models.DataKind.wgs).scalar()
filter(models.FileToBackup.kind == models.DataKind.wgs).scalar() or 0
except SQLAlchemyError as e:
return Response(json_body={"error": e._message()}, content_type='application/json', status=500)
......@@ -124,4 +124,4 @@ def file_location(request):
# batch info -- for batch id
@view_config(route_name='batch_info', renderer='json', request_method='GET')
def batch_info(request):
return
\ No newline at end of file
return
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment