diff --git a/apps/member/admin.py b/apps/member/admin.py index 26695b3b..bd29557b 100644 --- a/apps/member/admin.py +++ b/apps/member/admin.py @@ -5,7 +5,6 @@ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ - from note.templatetags.pretty_money import pretty_money from note_kfet.admin import admin_site diff --git a/apps/member/forms.py b/apps/member/forms.py index c4849e2a..50fa9c47 100644 --- a/apps/member/forms.py +++ b/apps/member/forms.py @@ -132,19 +132,20 @@ class MembershipForm(forms.ModelForm): 'date_start': DatePickerInput(), } + class MembershipRolesForm(forms.ModelForm): user = forms.ModelChoiceField( queryset=User.objects, label=_("User"), disabled=True, widget=Autocomplete( - User, - attrs={ - 'api_url': '/api/user/', - 'name_field': 'username', - 'placeholder': 'Nom ...', - }, - ), + User, + attrs={ + 'api_url': '/api/user/', + 'name_field': 'username', + 'placeholder': 'Nom ...', + }, + ), ) roles = forms.ModelMultipleChoiceField( @@ -154,4 +155,4 @@ class MembershipRolesForm(forms.ModelForm): class Meta: model = Membership - fields = ('user', 'roles') \ No newline at end of file + fields = ('user', 'roles') diff --git a/apps/member/views.py b/apps/member/views.py index 2826d11b..30fbb139 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -672,9 +672,9 @@ class ClubMembersListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableV if 'search' in self.request.GET: pattern = self.request.GET['search'] qs = qs.filter( - Q(user__first_name__iregex='^' + pattern) | - Q(user__last_name__iregex='^' + pattern) | - Q(user__note__alias__normalized_name__iregex='^' + Alias.normalize(pattern)) + Q(user__first_name__iregex='^' + pattern) + | Q(user__last_name__iregex='^' + pattern) + | Q(user__note__alias__normalized_name__iregex='^' + Alias.normalize(pattern)) ) only_active = "only_active" not in self.request.GET or self.request.GET["only_active"] != '0' @@ -706,4 +706,4 @@ class ClubMembersListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableV context["only_active"] = "only_active" not in self.request.GET or self.request.GET["only_active"] != '0' - return context \ No newline at end of file + return context diff --git a/apps/treasury/admin.py b/apps/treasury/admin.py index 6e2d4304..33224ba7 100644 --- a/apps/treasury/admin.py +++ b/apps/treasury/admin.py @@ -39,4 +39,3 @@ class SogeCreditAdmin(admin.ModelAdmin): def has_add_permission(self, request): # Don't create a credit manually return False -