Commit 174d609f authored by Élie Bouttier's avatar Élie Bouttier

masquage de l’ancien champs de notes des adhérents si vide

parent 95a06bf4
......@@ -126,7 +126,9 @@ class UserAdmin(AdtSearchMixin, AuthUserAdmin):
def get_inline_instances(self, request, obj=None):
if obj:
inlines = (ProfileInline, AdhesionInline,)
inlines = (ProfileInline,)
if obj.adhesion.notes:
inlines += (AdhesionInline,)
else:
inlines = ()
return [inline(self.model, self.admin_site) for inline in inlines]
......@@ -188,7 +190,7 @@ class CorporationAdmin(AdtSearchMixin, admin.ModelAdmin):
get_adhesion_link.admin_order_field = 'adhesion__id'
def get_inline_instances(self, request, obj=None):
if obj:
if obj and obj.adhesion.notes:
inlines = (AdhesionInline,)
else:
inlines = ()
......
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