Skip to content

Commit

Permalink
Merge pull request #119 from jbernal0019/master
Browse files Browse the repository at this point in the history
Change file response from Flask's Response to Flask's send_file
  • Loading branch information
jbernal0019 authored Mar 5, 2022
2 parents 30c0d3e + 800e6c1 commit 410cd5a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
docker build --build-arg ENVIRONMENT=local -t fnndsc/pfcon:dev .
./make.sh -s -U -i
- name: nosetests
run: docker ps -a
run: docker exec $(docker ps -f name=pfcon_dev_stack_pfcon.1 -q) nosetests --exe tests
- name: teardown
run: |
./unmake.sh
Expand Down
2 changes: 1 addition & 1 deletion pfcon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Config:
STATIC_FOLDER = 'static'
DEBUG = False
TESTING = False
SERVER_VERSION = "4.0.0"
SERVER_VERSION = "4.0.1"

def __init__(self):
# Environment variables
Expand Down
5 changes: 3 additions & 2 deletions pfcon/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime, timedelta
import jwt

from flask import request, Response, current_app as app
from flask import request, send_file, current_app as app
from flask_restful import reqparse, abort, Resource

from .services import PmanService, ServiceException
Expand Down Expand Up @@ -175,7 +175,8 @@ def get(self, job_id):
swift = SwiftStore(app.config)
content = swift.getData(job_id)

return Response(content, mimetype='application/zip')
return send_file(content, attachment_filename=f'{job_id}.zip',
as_attachment=True, mimetype='application/zip')


class Auth(Resource):
Expand Down
4 changes: 2 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Flask==1.1.2
Flask-RESTful==0.3.8
Flask==2.0.3
Flask-RESTful==0.3.9
requests==2.27.1
keystoneauth1==4.3.1
python-keystoneclient==4.2.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name = 'pfcon',
version = '4.0.0',
version = '4.0.1',
description = '(Python) Process and File Controller',
long_description = readme,
author = 'FNNDSC Developers',
Expand Down

0 comments on commit 410cd5a

Please sign in to comment.