mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-13 21:39:23 +00:00
use ruff for formating
Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user