@register.simple_tag
def identity_modify_link(identity, active_tab='default'):
    linkdef = {"label": identity.identity, "modal": True}
    if identity.__class__.__name__ == "User":
        linkdef["url"] = reverse("admin:account_change", args=[identity.id])
        linkdef["url"] += "?active_tab=%s" % active_tab
        linkdef["modalcb"] = "admin.editaccount_cb"
    else:
        linkdef["url"] = reverse("admin:alias_change", args=[identity.id])
        linkdef["modalcb"] = "admin.aliasform_cb"
    return render_link(linkdef)
Return the appropriate modification link.
dataset/ETHPy150Open tonioo/modoboa/modoboa/admin/templatetags/admin_tags.py/identity_modify_link