Commits

Tino de Bruijn  committed 8017dbc

change form.errors[] to form._errors and added non-field errors correctly

  • Participants
  • Parent commits b73f98d

Comments (0)

Files changed (1)

File simple_mail_merge/views.py

                     " message. Please make sure all variables are look like" \
                     " {{ this }}, are lower-case and present in the header" \
                     " of the uploaded file")
-                form.errors['message'] = error
+                form._errors['message'] = error
                 errors = 1
             try:
                 receivers = map_csv_file(form.cleaned_data['receivers'])
             except Exception, e:
-                form.errors['receivers'] = _("There is an error in your" \
+                form._errors['receivers'] = _("There is an error in your" \
                     "file: %s" % e)
                 errors = 1
             sender_email = "%s@%s" % (form.cleaned_data['sender_user'],
                     auth_user=form.cleaned_data['auth_user'],
                     auth_password=form.cleaned_data['auth_password'])
             except smtplib.SMTPException, e:
-                form.errors[forms.NON_FIELD_ERRORS] = \
+                form._errors['__all__'] = \
                     _("An error occurred upon sending: %s" % e)
                 errors = 1
             if errors: