mirror of https://gitlab.crans.org/bde/nk20
💚 Fix linters
This commit is contained in:
parent
377397b319
commit
b5586c647b
|
@ -5,7 +5,6 @@ from django.contrib import admin
|
||||||
from django.contrib.auth.admin import UserAdmin
|
from django.contrib.auth.admin import UserAdmin
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from note.templatetags.pretty_money import pretty_money
|
from note.templatetags.pretty_money import pretty_money
|
||||||
from note_kfet.admin import admin_site
|
from note_kfet.admin import admin_site
|
||||||
|
|
||||||
|
|
|
@ -132,19 +132,20 @@ class MembershipForm(forms.ModelForm):
|
||||||
'date_start': DatePickerInput(),
|
'date_start': DatePickerInput(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class MembershipRolesForm(forms.ModelForm):
|
class MembershipRolesForm(forms.ModelForm):
|
||||||
user = forms.ModelChoiceField(
|
user = forms.ModelChoiceField(
|
||||||
queryset=User.objects,
|
queryset=User.objects,
|
||||||
label=_("User"),
|
label=_("User"),
|
||||||
disabled=True,
|
disabled=True,
|
||||||
widget=Autocomplete(
|
widget=Autocomplete(
|
||||||
User,
|
User,
|
||||||
attrs={
|
attrs={
|
||||||
'api_url': '/api/user/',
|
'api_url': '/api/user/',
|
||||||
'name_field': 'username',
|
'name_field': 'username',
|
||||||
'placeholder': 'Nom ...',
|
'placeholder': 'Nom ...',
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
roles = forms.ModelMultipleChoiceField(
|
roles = forms.ModelMultipleChoiceField(
|
||||||
|
|
|
@ -672,9 +672,9 @@ class ClubMembersListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableV
|
||||||
if 'search' in self.request.GET:
|
if 'search' in self.request.GET:
|
||||||
pattern = self.request.GET['search']
|
pattern = self.request.GET['search']
|
||||||
qs = qs.filter(
|
qs = qs.filter(
|
||||||
Q(user__first_name__iregex='^' + pattern) |
|
Q(user__first_name__iregex='^' + pattern)
|
||||||
Q(user__last_name__iregex='^' + pattern) |
|
| Q(user__last_name__iregex='^' + pattern)
|
||||||
Q(user__note__alias__normalized_name__iregex='^' + Alias.normalize(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'
|
only_active = "only_active" not in self.request.GET or self.request.GET["only_active"] != '0'
|
||||||
|
|
|
@ -39,4 +39,3 @@ class SogeCreditAdmin(admin.ModelAdmin):
|
||||||
def has_add_permission(self, request):
|
def has_add_permission(self, request):
|
||||||
# Don't create a credit manually
|
# Don't create a credit manually
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue