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

@ -698,9 +698,11 @@ class User(AbstractBaseUser):
<em>%s</em>
</a>
""" % (
self.profile_pict.get_download_url()
if self.profile_pict
else staticfiles_storage.url("core/img/unknown.jpg"),
(
self.profile_pict.get_download_url()
if self.profile_pict
else staticfiles_storage.url("core/img/unknown.jpg")
),
_("Profile"),
escape(self.get_display_name()),
)

View File

@ -23,9 +23,9 @@
#
"""
This page is useful for custom migration tricks.
Sometimes, when you need to have a migration hack and you think it can be
useful again, put it there, we never know if we might need the hack again.
This page is useful for custom migration tricks.
Sometimes, when you need to have a migration hack and you think it can be
useful again, put it there, we never know if we might need the hack again.
"""
from django.db import connection, migrations

View File

@ -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):

View File

@ -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):

View File

@ -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

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)