Skip to content

Commit

Permalink
Clean repodata.json from empty platform when deleting a package
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Jul 26, 2022
1 parent 15d9a4c commit 4342433
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion quetz/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,10 @@ def delete_package(
os.path.join(version.platform, version.filename)
for version in package.package_versions # type: ignore
]

# get current platform containing the package
platforms = set([version.platform for version in package.package_versions])

channel_name = package.channel_name

db.delete(package)
Expand All @@ -873,7 +877,7 @@ def delete_package(

wrapped_bg_task = background_task_wrapper(indexing.update_indexes, logger)
# Background task to update indexes
background_tasks.add_task(wrapped_bg_task, dao, pkgstore, channel_name)
background_tasks.add_task(wrapped_bg_task, dao, pkgstore, channel_name, platforms)


@api_router.post(
Expand Down

0 comments on commit 4342433

Please sign in to comment.