use ruff for formating

Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
This commit is contained in:
thomas girod
2024-06-24 11:56:38 +02:00
parent e06bc7dba3
commit 9bdf3fc4ac
16 changed files with 105 additions and 181 deletions

View File

@ -100,9 +100,8 @@ def search_club(query, as_json=False):
if query:
clubs = Club.objects.filter(name__icontains=query).all()
clubs = clubs[:5]
if (
as_json
): # Re-loads json to avoid double encoding by JsonResponse, but still benefit from serializers
if as_json:
# Re-loads json to avoid double encoding by JsonResponse, but still benefit from serializers
clubs = json.loads(serializers.serialize("json", clubs, fields=("name")))
else:
clubs = list(clubs)