[Django]-Doubled POST requests instead of single

1👍

Why are you instantiating a new form after you save the original one?

if form.is_valid():
    form.save()
    # what's the point of the next line?
    form = EventForm(instance=event)

This is almost certainly the cause of your duplicated __init__ call. Why are you doing it? You already have a form.

Also, you’ve forgotten to stop the click action from completing within your JS.

$("#event-data-save").livequery("click", function(e) {
    e.preventDefault();
    ...
})

Leave a comment