Reformat files using black.

This commit is contained in:
Tom Hacohen 2020-12-29 15:37:11 +02:00
parent e6b47ae1a9
commit 8bf04fc286
2 changed files with 11 additions and 3 deletions

View File

@ -534,14 +534,20 @@ def fetch_updates(
@item_router.post("/item/transaction/", dependencies=[Depends(has_write_access), *PERMISSIONS_READWRITE]) @item_router.post("/item/transaction/", dependencies=[Depends(has_write_access), *PERMISSIONS_READWRITE])
def item_transaction( def item_transaction(
collection_uid: str, data: ItemBatchIn, stoken: t.Optional[str] = None, user: UserType = Depends(get_authenticated_user) collection_uid: str,
data: ItemBatchIn,
stoken: t.Optional[str] = None,
user: UserType = Depends(get_authenticated_user),
): ):
return item_bulk_common(data, user, stoken, collection_uid, validate_etag=True) return item_bulk_common(data, user, stoken, collection_uid, validate_etag=True)
@item_router.post("/item/batch/", dependencies=[Depends(has_write_access), *PERMISSIONS_READWRITE]) @item_router.post("/item/batch/", dependencies=[Depends(has_write_access), *PERMISSIONS_READWRITE])
def item_batch( def item_batch(
collection_uid: str, data: ItemBatchIn, stoken: t.Optional[str] = None, user: UserType = Depends(get_authenticated_user) collection_uid: str,
data: ItemBatchIn,
stoken: t.Optional[str] = None,
user: UserType = Depends(get_authenticated_user),
): ):
return item_bulk_common(data, user, stoken, collection_uid, validate_etag=False) return item_bulk_common(data, user, stoken, collection_uid, validate_etag=False)

View File

@ -56,7 +56,9 @@ def _sanitize_path(filepath):
try: try:
filepath_abs.relative_to(path_root) filepath_abs.relative_to(path_root)
except ValueError: except ValueError:
raise HttpError("generic", "{} wrt {} is impossible".format(filepath_abs, path_root), status_code=status.HTTP_404_NOT_FOUND) raise HttpError(
"generic", "{} wrt {} is impossible".format(filepath_abs, path_root), status_code=status.HTTP_404_NOT_FOUND
)
return filepath_abs return filepath_abs