Commit 39a31f0f authored by Élie Bouttier's avatar Élie Bouttier

trie adhésion par n°

parent 5ca00500
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment