Skip to content

Commit

Permalink
sam-download: handle version as string
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Mar 16, 2022
1 parent 2f14c92 commit 8ef94de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mpcontribs-portal/mpcontribs/portal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def make_download(headers, query, include=None):
except ClientError:
try:
s3_resp = s3_client.head_object(Bucket=BUCKET, Key=key)
next_version = s3_resp["Metadata"].get("version", 1) + 1
next_version = int(s3_resp["Metadata"].get("version", 1)) + 1
except ClientError:
next_version = 1 # about to generate first version

Expand Down
4 changes: 2 additions & 2 deletions mpcontribs-sam-download/make_download/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def lambda_handler(event, context):
store.ping()
store.set(redis_key, "ONGOING")

project, query, include = event["project"], event["query"], event["include"]
query, include = event["query"], event["include"]
project = query["project"]
bucket, filename, fmt, version = redis_key.split(":")
version = int(version)

try:
client = Client(
Expand Down

0 comments on commit 8ef94de

Please sign in to comment.