Skip to content

Commit

Permalink
Merge pull request #147 from paulsaxe/main
Browse files Browse the repository at this point in the history
Fixed error uploading files for jobs.
  • Loading branch information
seamm authored Mar 27, 2024
2 parents 732ae1b + ba34379 commit 2b3774b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
7 changes: 4 additions & 3 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ dependencies:
- pip
- python<3.12

- connexion
- connexion<3.0
- email-validator
- fasteners
- flask>2.0
- flask<3.0
- flask-authorize
- flask-bootstrap
- flask-cors
Expand Down Expand Up @@ -41,4 +41,5 @@ dependencies:
- nodejs
- twine


# - pip:
# - connexion[flask,swagger-ui]
20 changes: 13 additions & 7 deletions seamm_dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,19 @@ def create_app(config_name=None):

logger.info("")

logger.info(
"Running in "
+ app.config["ENV"]
+ " mode with database "
+ app.config["SQLALCHEMY_DATABASE_URI"]
)

if "ENV" in app.config:
logger.info(
"Running in "
+ app.config["ENV"]
+ " mode with database "
+ app.config["SQLALCHEMY_DATABASE_URI"]
)
else:
logger.info(
"Running with database "
+ app.config["SQLALCHEMY_DATABASE_URI"]
)

# Authorization configuration
app.config["AUTHORIZE_DEFAULT_PERMISSIONS"] = dict(
owner=["read", "update", "delete", "create", "manage"],
Expand Down
10 changes: 9 additions & 1 deletion seamm_dashboard/routes/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,15 @@ def add_file_to_job(body, id=None):
-------
The job id (integer)
"""
job_info, status = get_job(id)
response, status = get_job(id)
if status != 200:
return response

logger.debug(f"response from get_job: {type(response)}")
logger.debug(response)
job_info = response.get_json()
logger.debug(job_info)

root = Path(job_info["path"])

file_data = request.files["file"]
Expand Down

0 comments on commit 2b3774b

Please sign in to comment.