Skip to content

Commit e02e1c8

Browse files
VaibhavSingh8lakshayman
authored andcommitted
fix: lint and format
1 parent 191735a commit e02e1c8

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

todo/middlewares/jwt_auth.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def __call__(self, request):
4747
],
4848
)
4949
return JsonResponse(
50-
data=error_response.model_dump(mode="json", exclude_none=True),
51-
status=status.HTTP_401_UNAUTHORIZED
50+
data=error_response.model_dump(mode="json", exclude_none=True), status=status.HTTP_401_UNAUTHORIZED
5251
)
5352

5453
except (TokenMissingError, TokenExpiredError, TokenInvalidError) as e:
@@ -67,8 +66,7 @@ def __call__(self, request):
6766
],
6867
)
6968
return JsonResponse(
70-
data=error_response.model_dump(mode="json", exclude_none=True),
71-
status=status.HTTP_401_UNAUTHORIZED
69+
data=error_response.model_dump(mode="json", exclude_none=True), status=status.HTTP_401_UNAUTHORIZED
7270
)
7371

7472
def _try_authentication(self, request) -> bool:
@@ -188,8 +186,7 @@ def _handle_rds_auth_error(self, exception):
188186
errors=[ApiErrorDetail(title=ApiErrors.AUTHENTICATION_FAILED, detail=str(exception))],
189187
)
190188
return JsonResponse(
191-
data=error_response.model_dump(mode="json", exclude_none=True),
192-
status=status.HTTP_401_UNAUTHORIZED
189+
data=error_response.model_dump(mode="json", exclude_none=True), status=status.HTTP_401_UNAUTHORIZED
193190
)
194191

195192
def _handle_google_auth_error(self, exception):
@@ -199,8 +196,7 @@ def _handle_google_auth_error(self, exception):
199196
errors=[ApiErrorDetail(title=ApiErrors.AUTHENTICATION_FAILED, detail=str(exception))],
200197
)
201198
return JsonResponse(
202-
data=error_response.model_dump(mode="json", exclude_none=True),
203-
status=status.HTTP_401_UNAUTHORIZED
199+
data=error_response.model_dump(mode="json", exclude_none=True), status=status.HTTP_401_UNAUTHORIZED
204200
)
205201

206202

@@ -237,4 +233,4 @@ def get_current_user_info(request) -> dict:
237233
}
238234
)
239235

240-
return user_info
236+
return user_info

todo/tests/integration/base_mongo_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ def get_user_model(self) -> UserModel:
7575
name=self.user_data["name"],
7676
createdAt=datetime.now(timezone.utc),
7777
updatedAt=datetime.now(timezone.utc),
78-
)
78+
)

todo/tests/unit/views/test_auth.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def setUp(self):
108108
self.url = reverse("google_callback")
109109
self.factory = APIRequestFactory()
110110
self.view = GoogleCallbackView.as_view()
111-
111+
112112
self.test_user_data = users_db_data[0]
113113

114114
self.test_user_data = users_db_data[0]
@@ -150,6 +150,10 @@ def test_get_redirects_for_valid_code_and_state(self, mock_create_user, mock_han
150150
"email": self.test_user_data["email_id"],
151151
"name": self.test_user_data["name"],
152152
}
153+
<<<<<<< HEAD
154+
=======
155+
156+
>>>>>>> a57ab63 (fix: lint and format)
153157
user_id = str(ObjectId())
154158
mock_user = Mock()
155159
mock_user.id = ObjectId(user_id)

todo/views/auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from todo.constants.messages import ApiErrors, AppMessages
1414
from todo.middlewares.jwt_auth import get_current_user_info
1515

16+
1617
class GoogleLoginView(APIView):
1718
@extend_schema(
1819
operation_id="google_login",
@@ -155,6 +156,7 @@ def _set_auth_cookies(self, response, tokens):
155156
"ext-refresh", tokens["refresh_token"], max_age=settings.GOOGLE_JWT["REFRESH_TOKEN_LIFETIME"], **config
156157
)
157158

159+
158160
class GoogleLogoutView(APIView):
159161
@extend_schema(
160162
operation_id="google_logout",

0 commit comments

Comments
 (0)