[Answered ]-Can someone help? Sending notifications to all users or some users in django forms

1👍

From the docs:

every time you save a form using commit=False, Django adds a save_m2m() method to your ModelForm subclass. After you’ve manually saved the instance produced by the form, you can invoke save_m2m() to save the many-to-many form data.

So you’ll have to call save_m2m() after instance.save() if you are using commit=False:

        instance = form.save(commit=False)
        instance.message_reply = "none"
        instance.save()
        form.save_m2m() # <-- Add this

Leave a comment