Skip to content

Deleting instance not working when hideLastAddForm is true #197

@corneliusabel

Description

@corneliusabel

When using inline formsets (extra=1, can_delete=True) and hideLastAddForm=true the deletion of an instance (after submitting) fails. However, with hideLastAddForm=false deletion works.
I noticed that the only difference in the POST requests was the "TOTAL_FORMS" field which was n-1 when hideLastAddForm=true. That has prevented the deletion of the object in django.
By commenting out line "totalForms.val(forms.length);" in line 95 (1.5-pre) i could fix that for me.

However, iam not an javascript expert so not sure if this is the right solution?

Best,

Cornelius

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions