Beispiel #1
0
    def form_valid(self, form):
        # header = "{email} supplied a form!".format(
        #     email=form.cleaned_data.get('email_address'))
        # message = "\n\nType: {0}".format(form.cleaned_data.get('ticket_type').encode('utf-8'))
        # message += "\n\nCourt: {0}".format(form.cleaned_data.get('group_court'))
        # message += "\n\ncontact_method: {0}".format(form.cleaned_data.get('contact_method'))
        # send_mail(
        #     subject=header,
        #     message=message,
        #     from_email='*****@*****.**',
        #     recipient_list=['*****@*****.**'],
        # )
        
        c = Submission()

        c.software_download = form.cleaned_data.get('software_download')
        c.email_address = form.cleaned_data.get('email_address')
        c.submitter_name = form.cleaned_data.get('submitter_name')
        c.institution = form.cleaned_data.get('institution')
        
        c.save()
        
        return super(ContactFormView, self).form_valid(form)