From 21b98b11f0d7482b214afa7ff1c0f47522131cb1 Mon Sep 17 00:00:00 2001 From: jiisanda Date: Sun, 15 Dec 2024 03:43:55 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20pylint=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pylint.yml | 2 +- app/api/routes/documents/notify.py | 11 +++++------ app/db/repositories/documents/documents_metadata.py | 7 +++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 977aaa7..e6bc066 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -21,4 +21,4 @@ jobs: pip install -r requirements.txt - name: Analysing the code with pylint run: | - pylint $(git ls-files '*.py') --disable=E0401,C0116,C0114,C0115,C0301,R0913,R0917,R0903,C0103,E1101 + pylint $(git ls-files '*.py') --disable=E0401,C0116,C0114,C0115,C0301,R0913,R0914,R0917,R0903,C0103,E1101,W0611 diff --git a/app/api/routes/documents/notify.py b/app/api/routes/documents/notify.py index a4d9b75..03a1ac9 100644 --- a/app/api/routes/documents/notify.py +++ b/app/api/routes/documents/notify.py @@ -68,13 +68,12 @@ async def patch_status( if updated_status.mark_all: return await repository.mark_all_read(user=user) - elif notification_id: + if notification_id: return await repository.update_status(n_id=notification_id, updated_status=updated_status, user=user) - else: - raise http_404( - msg="Bad Request: Make sure to either flag mark_all " - "or enter notification_id along with correct status as payload." - ) + raise http_404( + msg="Bad Request: Make sure to either flag mark_all " + "or enter notification_id along with correct status as payload." + ) @router.delete( diff --git a/app/db/repositories/documents/documents_metadata.py b/app/db/repositories/documents/documents_metadata.py index e9770a6..c660218 100644 --- a/app/db/repositories/documents/documents_metadata.py +++ b/app/db/repositories/documents/documents_metadata.py @@ -274,10 +274,9 @@ async def restore(self, file: str, owner: TokenData) -> DocumentMetadataRead: raise http_409( msg="Doc is not deleted" ) - else: - raise http_404( - msg="Doc does not exists" - ) + raise http_404( + msg="Doc does not exists" + ) async def perm_delete_a_doc(self, document: UUID | None, owner: TokenData) -> None: