Browse Source

trie adhésion par n°

Élie Bouttier 6 years ago
parent
commit
39a31f0f1f
1 changed files with 2 additions and 10 deletions
  1. 2 10
      adhesions/admin.py

+ 2 - 10
adhesions/admin.py

@@ -120,13 +120,9 @@ class UserAdmin(AdtSearchMixin, AuthUserAdmin):
     readonly_fields = ('get_adhesion_link',)
     adhesion_search_field = 'adhesion__id'
 
-    def get_adhesion_id(self, user):
-        return user.adhesion
-    get_adhesion_id.short_description = 'Numéro d’adhérent·e'
-    get_adhesion_id.admin_order_field = 'adhesion__id'
-
     get_adhesion_link = lambda self, corporation: corporation.adhesion.get_adhesion_link()
     get_adhesion_link.short_description = Adhesion.get_adhesion_link.short_description
+    get_adhesion_link.admin_order_field = 'adhesion__id'
 
     def get_inline_instances(self, request, obj=None):
         if obj:
@@ -187,13 +183,9 @@ class CorporationAdmin(AdtSearchMixin, admin.ModelAdmin):
     filter_horizontal = ('members',)
     adhesion_search_field = 'adhesion__id'
 
-    def get_adhesion_id(self, corp):
-        return corp.adhesion
-    get_adhesion_id.short_description = 'Numéro d’adhérent·e'
-    get_adhesion_id.admin_order_field = 'adhesion__id'
-
     get_adhesion_link = lambda self, corporation: corporation.adhesion.get_adhesion_link()
     get_adhesion_link.short_description = Adhesion.get_adhesion_link.short_description
+    get_adhesion_link.admin_order_field = 'adhesion__id'
 
     def get_inline_instances(self, request, obj=None):
         if obj: