steambird/teacher/views.py
def form_valid(self, form: Form) -> HttpResponseRedirect:
        """
        Makes sure the data is saved after submission.

        :param form: The form and its data.
        :return: a redirect to get_success_url.
        """
        new_mspline = form.save(commit=False)
        new_mspline.created_by = self.request.user
        new_mspline.created_by_side = "TEACHER"
        new_mspline.save()
        form.save_m2m()
        return super().form_valid(form)

        Makes sure the data is saved after submission.

        :param form: The form and its data.
        :return: a redirect to get_success_url.
        
Makes sure the data is saved after submission.
Makes sure the data is saved after submission .
def form_valid(self, form: Form) -> HttpResponseRedirect:
        new_mspline = form.save(commit=False)
        new_mspline.created_by = self.request.user
        new_mspline.created_by_side = "TEACHER"
        new_mspline.save()
        form.save_m2m()
        return super().form_valid(form)
def form_valid ( self , form : Form ) -> HttpResponseRedirect : new_mspline = form . save ( commit = False ) new_mspline . created_by = self . request . user new_mspline . created_by_side = "TEACHER" new_mspline . save ( ) form . save_m2m ( ) return super ( ) . form_valid ( form )
Makes sure the data is saved after submission.
Makes sure the data is saved after submission .
"""
        Makes sure the data is saved after submission.

        :param form: The form and its data.
        :return: a redirect to get_success_url.
        """
a redirect to get_success_url.
a redirect to get_success_url .
self
form
Form
The form and its data.
The form and its data .