Fakultas Ilmu Komputer UI

Commit d9a9aac1 authored by Ami's avatar Ami
Browse files

simplifying views

parent b231b451
Pipeline #79216 passed with stages
in 13 minutes and 9 seconds
......@@ -33,9 +33,8 @@ class GetProfilesViewSet(generics.ListAPIView):
name = self.request.query_params.get('name')
if name is not None:
u_capital = name.capitalize()
u_lower = name.lower()
queryset = queryset.filter(Q(name__contains=u_capital) | Q(name__contains=u_lower))
queryset = queryset.filter(Q(name__contains=name.capitalize())
| Q(name__contains=name.lower()))
queryset = queryset.order_by('name')
return queryset
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment