Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.2.0"
".": "1.2.1"
}
2 changes: 1 addition & 1 deletion .release-please-manifest.staging.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.2.0"
".": "1.2.1"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.2.1](https://github.com/DataIntegrationGroup/OcotilloAPI/compare/v1.2.0...v1.2.1) (2026-07-29)


### Bug Fixes

* **api/asset:** update access from admin to editor ([3bed220](https://github.com/DataIntegrationGroup/OcotilloAPI/commit/3bed220a84b129bc65fbb4b97441c35e518f7414))

## [1.2.0](https://github.com/DataIntegrationGroup/OcotilloAPI/compare/v1.1.5...v1.2.0) (2026-07-22)


Expand Down
17 changes: 8 additions & 9 deletions api/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from core.dependencies import (
session_dependency,
viewer_dependency,
admin_dependency,
editor_dependency,
)
from db import Thing
Expand Down Expand Up @@ -141,7 +140,7 @@ def database_error_handler(payload: CreateAsset, error: ProgrammingError) -> Non
status_code=HTTP_201_CREATED,
)
async def upload_asset(
user: admin_dependency,
user: editor_dependency,
bucket=Depends(get_storage_bucket),
file: UploadFile = File(...),
) -> dict:
Expand Down Expand Up @@ -171,7 +170,7 @@ async def upload_asset(

@router.post("/upload-and-record", status_code=HTTP_201_CREATED)
async def upload_and_record_asset(
user: admin_dependency,
user: editor_dependency,
session: session_dependency,
bucket=Depends(get_storage_bucket),
file: UploadFile = File(...),
Expand All @@ -188,7 +187,7 @@ async def upload_and_record_asset(
returned instead of creating a duplicate.

Args:
user: Authenticated admin user performing the upload.
user: Authenticated editor user performing the upload.
session: Active database session.
bucket: GCS storage bucket resolved via dependency injection.
file: The file to upload. Accepted MIME types: JPEG, PNG, GIF, WebP,
Expand Down Expand Up @@ -384,10 +383,10 @@ async def upload_and_record_asset(

@router.post("", status_code=HTTP_201_CREATED)
async def add_asset(
user: admin_dependency,
user: editor_dependency,
session: session_dependency,
asset_data: CreateAsset,
) -> AssetResponse:
) -> AssetResponse | None:

try:
data = asset_data.model_dump()
Expand Down Expand Up @@ -446,7 +445,7 @@ async def add_asset(
async def list_assets(
user: viewer_dependency,
session: session_dependency,
thing_id: int = None,
thing_id: int | None = None,
) -> CustomPage[AssetResponse]:
"""
List all assets or assets associated with a specific thing.
Expand Down Expand Up @@ -579,7 +578,7 @@ async def update_asset(

@router.delete("/{asset_id}", status_code=HTTP_204_NO_CONTENT)
async def delete_asset(
asset_id: int, session: session_dependency, user: admin_dependency
asset_id: int, session: session_dependency, user: editor_dependency
):
return model_deleter(session, Asset, asset_id, user=user)

Expand All @@ -589,7 +588,7 @@ async def delete_asset(
status_code=HTTP_204_NO_CONTENT,
)
async def remove_asset(
user: admin_dependency,
user: editor_dependency,
asset_id: int,
session: session_dependency,
bucket=Depends(get_storage_bucket),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "OcotilloAPI"
version = "1.2.0"
version = "1.2.1"
description = "FastAPI backend and CLI for managing Ocotillo groundwater locations, wells, assets, and bulk water-level data transfers."
readme = "README.md"
requires-python = ">=3.13"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading