[black] add action

This commit is contained in:
Piotr Domański 2024-05-17 14:15:31 +02:00
parent 9ecb13aed0
commit e44b6a1cb3
2 changed files with 13 additions and 1 deletions

10
.github/workflows/black.yml vendored Normal file
View file

@ -0,0 +1,10 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable

View file

@ -66,6 +66,8 @@ class GetProductByBarCode(AuthorizedController):
)
await session.commit()
return Product.from_orm(await DBProduct.get_by_barcode(session, barcode))
return Product.from_orm(
await DBProduct.get_by_barcode(session, barcode)
)
except AssertionError as e:
raise HTTPException(status_code=400, detail=e.args[0])