|
@@ -84,10 +84,11 @@ class OfferSubscriptionInline(admin.TabularInline):
|
|
|
|
|
|
|
|
|
class MemberAdmin(UserAdmin):
|
|
|
- list_display = ('id', 'status', 'username', 'first_name', 'last_name',
|
|
|
- 'nickname', 'organization_name', 'email',
|
|
|
+ list_display = ('id', 'status', 'username', 'first_name',
|
|
|
+ 'name_or_organization_name',
|
|
|
+ 'nickname', 'email',
|
|
|
'end_date_of_membership')
|
|
|
- list_display_links = ('id', 'username', 'first_name', 'last_name')
|
|
|
+ list_display_links = ('id', 'username', 'first_name', 'name_or_organization_name')
|
|
|
list_filter = ('status', MembershipFeeFilter)
|
|
|
search_fields = ['username', 'first_name', 'last_name', 'email', 'nickname']
|
|
|
ordering = ('status', 'username')
|
|
@@ -97,6 +98,11 @@ class MemberAdmin(UserAdmin):
|
|
|
form = AdminMemberChangeForm
|
|
|
add_form = MemberCreationForm
|
|
|
|
|
|
+ def name_or_organization_name(self, obj):
|
|
|
+ """ Used to spare some horizontal space in list view"""
|
|
|
+ return obj.organization_name or obj.last_name
|
|
|
+ name_or_organization_name.short_description = 'Nom'
|
|
|
+
|
|
|
def get_fieldsets(self, request, obj=None):
|
|
|
coord_fieldset = ('Coordonnées', {'fields': (
|
|
|
('email', 'send_membership_fees_email'),
|