Skip to content

Commit 8ce59fb

Browse files
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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
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
authored and
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
committed
fix: flake8 y black + delete bad test
1 parent 7c5e44e commit 8ce59fb

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

Diff for: authentication/tests/tests.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
from rest_framework.test import APIClient
44
from rest_framework import status
55
from authentication.services.cognito_service import CognitoService
6-
from authentication.models import User
7-
<<<<<<< HEAD
86
from authentication.views import ProfileView
97
from rest_framework.response import Response
10-
=======
11-
from authentication.views import UserSearchView
12-
>>>>>>> test: usersearchview
138

149

1510
class RegisterViewTests(TestCase):

Diff for: authentication/views.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,12 @@ class UserSearchView(APIView):
5959
@cognito_authenticated
6060
def get(self, request):
6161
try:
62-
search = request.query_params.get('search', '').lower()
62+
search = request.query_params.get("search", "").lower()
6363
list_of_users = User.objects.all()
6464
filtered_users = [
65-
{
66-
"username": user.username,
67-
"first_name": user.first_name,
68-
"email": user.email,
69-
"phone": user.phone
70-
} for user in list_of_users if search in user.first_name.lower() or search in user.email.lower()
65+
{"username": user.username, "first_name": user.first_name, "email": user.email, "phone": user.phone}
66+
for user in list_of_users
67+
if search in user.first_name.lower() or search in user.email.lower()
7168
]
7269
return Response(filtered_users)
7370
except User.DoesNotExist:

0 commit comments

Comments
 (0)