Skip to content

Commit

Permalink
Merge pull request #696 from RockefellerArchiveCenter/issue-695
Browse files Browse the repository at this point in the history
Truncate machine name before creating bucket
  • Loading branch information
helrond authored Dec 5, 2024
2 parents 7d3a4c5 + 37bdbf1 commit c91d631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bag_transfer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def admin_users(self):
@property
def upload_target(self):
if settings.S3_USE:
return f"{settings.S3_PREFIX}-{self.machine_name}-upload"
max_len = 63 - len(settings.S3_PREFIX) - 8 # ensure bucket name will not exceed max length
machine_name_truncated = self.machine_name[:max_len]
return f"{settings.S3_PREFIX}-{machine_name_truncated}-upload"
else:
return join(settings.TRANSFER_UPLOADS_ROOT.rstrip("/"), self.machine_name, "upload")

Expand Down

0 comments on commit c91d631

Please sign in to comment.