Skip to content

Commit

Permalink
fix for dlname not getting set on dmcbucket files
Browse files Browse the repository at this point in the history
  • Loading branch information
pgm committed Dec 7, 2024
1 parent f378088 commit 279959a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions portal-backend/depmap/download/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def __init__(self, file_name):
class DmcBucketUrl(BucketUrl):
BUCKET = "depmap-dmc-downloads"

def __init__(self, file_name):
super().__init__(DmcBucketUrl.BUCKET, file_name)
def __init__(self, file_name, dl_name=None):
super().__init__(DmcBucketUrl.BUCKET, file_name=file_name, dl_name=dl_name)

def __repr__(self):
return "DmcBucketUrl({})".format(repr(self.file_name))
Expand Down
6 changes: 4 additions & 2 deletions portal-backend/depmap/settings/parse_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ def get_summary_stats(stats: List[Dict[str, Any]]) -> SummaryStats:

def get_bucket(url: dict):
if url.get("bucket", "") == DmcBucketUrl.BUCKET:
return DmcBucketUrl(url.get("file_name", ""))
return DmcBucketUrl(url.get("file_name", ""), dl_name=url.get("dl_name", ""))
else:
return BucketUrl(
url.get("bucket", ""), url.get("file_name", ""), url.get("dl_name", "")
url.get("bucket", ""),
url.get("file_name", ""),
dl_name=url.get("dl_name", ""),
)


Expand Down

0 comments on commit 279959a

Please sign in to comment.