<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>

<script>
document.addEventListener("DOMContentLoaded", function() {
    // Vérifie si le formulaire contient des erreurs
    var formErrors = {{ complet_form.non_field_errors|length|default:0 }};
    if (formErrors > 0) {
        // Ouvre la modale
        var modal = new bootstrap.Modal(document.getElementById('modalModifierProfil'));
        modal.show();
    }
});
</script>
