mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
use ruff for formating
Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
This commit is contained in:
@ -314,9 +314,8 @@ class QuickNotifMixin:
|
||||
quick_notif_list = []
|
||||
|
||||
def dispatch(self, request, *arg, **kwargs):
|
||||
self.quick_notif_list = (
|
||||
[]
|
||||
) # In some cases, the class can stay instanciated, so we need to reset the list
|
||||
# In some cases, the class can stay instanciated, so we need to reset the list
|
||||
self.quick_notif_list = []
|
||||
return super(QuickNotifMixin, self).dispatch(request, *arg, **kwargs)
|
||||
|
||||
def get_success_url(self):
|
||||
|
@ -97,12 +97,10 @@ class _MultipleFieldMixin:
|
||||
return result
|
||||
|
||||
|
||||
class MultipleFileField(_MultipleFieldMixin, forms.FileField):
|
||||
...
|
||||
class MultipleFileField(_MultipleFieldMixin, forms.FileField): ...
|
||||
|
||||
|
||||
class MultipleImageField(_MultipleFieldMixin, forms.ImageField):
|
||||
...
|
||||
class MultipleImageField(_MultipleFieldMixin, forms.ImageField): ...
|
||||
|
||||
|
||||
class AddFilesForm(forms.Form):
|
||||
|
@ -15,7 +15,7 @@
|
||||
#
|
||||
|
||||
"""
|
||||
This module contains views to manage Groups
|
||||
This module contains views to manage Groups
|
||||
"""
|
||||
|
||||
from django.views.generic.edit import UpdateView, CreateView, DeleteView
|
||||
|
@ -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