Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions quetz/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,11 @@
dao: Dao = Depends(get_dao),
auth: authorization.Rules = Depends(get_rules),
):
# here we use the owner_id as user_id. In case the authentication
# was done using an API Key, we want to attribute the uploaded package
# to the owner of that API Key and not the anonymous API Key itself.
user_id = auth.assert_owner()

logger.debug(
f"Uploading file {filename} with checksum {sha256} to channel {channel_name}"
)
Expand All @@ -1481,11 +1486,6 @@
status_code=status.HTTP_406_NOT_ACCEPTABLE, detail="Wrong SHA256 checksum"
)

# here we use the owner_id as user_id. In case the authentication
# was done using an API Key, we want to attribute the uploaded package
# to the owner of that API Key and not the anonymous API Key itself.
user_id = auth.assert_owner()

auth.assert_create_package(channel_name)
condainfo = CondaInfo((body), filename)
_assert_filename_package_name_consistent(filename, condainfo.info["name"])
Expand Down Expand Up @@ -1818,7 +1818,7 @@
return None


@app.on_event("startup")

Check warning on line 1821 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, postgres, create-tables)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).

Check warning on line 1821 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, sqlite, create-tables)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).

Check warning on line 1821 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, postgres, use-migrations)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).

Check warning on line 1821 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, sqlite, use-migrations)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).
def start_sync_download_counts():
global download_counts
wait_time = 1 # seconds
Expand Down Expand Up @@ -1866,7 +1866,7 @@
app.sync_download_task = asyncio.create_task(task())


@app.on_event("shutdown")

Check warning on line 1869 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, postgres, create-tables)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).

Check warning on line 1869 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, sqlite, create-tables)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).

Check warning on line 1869 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, postgres, use-migrations)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).

Check warning on line 1869 in quetz/main.py

View workflow job for this annotation

GitHub Actions / test_quetz (ubuntu-latest, sqlite, use-migrations)

on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).
async def stop_sync_download_counts():
app.sync_download_task.cancel()
try:
Expand Down
Loading