Skip to content

Commit 80a98d0

Browse files
committed
fix lint
1 parent 6519922 commit 80a98d0

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

src/routers/member.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
@router.post("", response_model=Member)
1919
def create_member_folder(
20-
member: Member, authorized: Annotated[None, Depends(authorize)]
20+
member: Member,
21+
authorized: Annotated[None, Depends(authorize)], # pylint: disable=unused-argument
2122
):
2223
"""
2324
Create a folder structure for a member and return the member object.
@@ -31,7 +32,8 @@ def create_member_folder(
3132

3233
@router.put("", response_model=Member)
3334
def update_member_folder(
34-
member: Member, authorized: Annotated[None, Depends(authorize)]
35+
member: Member,
36+
authorized: Annotated[None, Depends(authorize)], # pylint: disable=unused-argument
3537
):
3638
"""
3739
Update the folder structure for a member and return the member object.
@@ -48,7 +50,9 @@ def update_member_folder(
4850

4951
@router.post("/{member_id}/profilePicture", response_model=UUID)
5052
async def upload_member_picture(
51-
member_id: UUID, file: UploadFile, authorized: Annotated[None, Depends(authorize)]
53+
member_id: UUID,
54+
file: UploadFile,
55+
authorized: Annotated[None, Depends(authorize)], # pylint: disable=unused-argument
5256
):
5357
"""
5458
Upload a picture for a member to convert

src/routers/video.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717

1818
@router.post("", response_model=Video)
19-
def create_video_folder(video: Video, authorized: Annotated[None, Depends(authorize)]):
19+
def create_video_folder(
20+
video: Video,
21+
authorized: Annotated[None, Depends(authorize)], # pylint: disable=unused-argument
22+
):
2023
"""
2124
Create a folder structure for a video and return the video object.
2225
:param video: Video object
@@ -28,7 +31,10 @@ def create_video_folder(video: Video, authorized: Annotated[None, Depends(author
2831

2932

3033
@router.put("", response_model=Video)
31-
def update_video_folder(video: Video, authorized: Annotated[None, Depends(authorize)]):
34+
def update_video_folder(
35+
video: Video,
36+
authorized: Annotated[None, Depends(authorize)], # pylint: disable=unused-argument
37+
):
3238
"""
3339
Update the folder structure for a video and return the video object.
3440
If the video does not exist, return a 404.
@@ -44,7 +50,9 @@ def update_video_folder(video: Video, authorized: Annotated[None, Depends(author
4450

4551
@router.post("/{video_id}/thumbnail", response_model=UUID)
4652
async def upload_video_poster(
47-
video_id: UUID, file: UploadFile, authorized: Annotated[None, Depends(authorize)]
53+
video_id: UUID,
54+
file: UploadFile,
55+
authorized: Annotated[None, Depends(authorize)], # pylint: disable=unused-argument
4856
):
4957
"""
5058
Upload a picture for a video thumbnail to convert

src/security.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Security module for the FastAPI application."""
2+
13
import secrets
24
from typing import Annotated
35

@@ -10,6 +12,12 @@
1012

1113

1214
def authorize(credentials: Annotated[HTTPBasicCredentials, Depends(security)]):
15+
"""
16+
Authorize the request with the correct username and password.
17+
The correct username and password are stored in the settings.
18+
:param credentials: the credentials from the request
19+
:return:
20+
"""
1321
current_username_bytes = credentials.username.encode("utf8")
1422
correct_username_bytes = settings.username.encode("utf8")
1523
is_correct_username = secrets.compare_digest(

0 commit comments

Comments
 (0)