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