|
@@ -17,7 +17,6 @@ from django.utils.safestring import mark_safe
|
|
|
|
|
|
from coin.members.models import (
|
|
|
Member, CryptoKey, LdapUser, MembershipFee, Offer, OfferSubscription, RowLevelPermission)
|
|
|
-from coin.members.membershipfee_filter import MembershipFeeFilter
|
|
|
from coin.members.forms import AdminMemberChangeForm, MemberCreationForm
|
|
|
from coin.utils import delete_selected
|
|
|
import autocomplete_light
|
|
@@ -84,6 +83,27 @@ class OfferSubscriptionInline(admin.TabularInline):
|
|
|
return request.user.is_superuser
|
|
|
|
|
|
|
|
|
+class MembershipFeeFilter(SimpleListFilter):
|
|
|
+ # Human-readable title which will be displayed in the
|
|
|
+ # right admin sidebar just above the filter options.
|
|
|
+ title = 'Cotisations'
|
|
|
+
|
|
|
+ # Parameter for the filter that will be used in the URL query.
|
|
|
+ parameter_name = 'fee'
|
|
|
+
|
|
|
+ def lookups(self, request, model_admin):
|
|
|
+ return (
|
|
|
+ ('paidup', 'À jour de cotisation'),
|
|
|
+ ('late', 'En retard'),
|
|
|
+ )
|
|
|
+
|
|
|
+ def queryset(self, request, queryset):
|
|
|
+ if self.value() == 'paidup':
|
|
|
+ return queryset.paidup_fee()
|
|
|
+ if self.value() == 'late':
|
|
|
+ return queryset.no_fee_or_late()
|
|
|
+
|
|
|
+
|
|
|
class MemberAdmin(UserAdmin):
|
|
|
list_display = ('id', 'status', 'username', 'first_name',
|
|
|
'name_or_organization_name',
|