Fix Artifact model field names in PyPI proxy
Use correct Artifact model fields: - original_name instead of filename - Add required created_by and s3_key fields - Include checksum fields from storage result
This commit is contained in:
@@ -469,10 +469,15 @@ async def pypi_download_file(
|
|||||||
# Create artifact record
|
# Create artifact record
|
||||||
new_artifact = Artifact(
|
new_artifact = Artifact(
|
||||||
id=sha256,
|
id=sha256,
|
||||||
filename=filename,
|
original_name=filename,
|
||||||
content_type=content_type,
|
content_type=content_type,
|
||||||
size=size,
|
size=size,
|
||||||
ref_count=1,
|
ref_count=1,
|
||||||
|
created_by="pypi-proxy",
|
||||||
|
s3_key=result.s3_key,
|
||||||
|
checksum_md5=result.md5,
|
||||||
|
checksum_sha1=result.sha1,
|
||||||
|
s3_etag=result.s3_etag,
|
||||||
)
|
)
|
||||||
db.add(new_artifact)
|
db.add(new_artifact)
|
||||||
db.flush()
|
db.flush()
|
||||||
|
|||||||
Reference in New Issue
Block a user