diff -r 56b52b25b4ed django/forms/forms.py
a
|
b
|
|
6 | 6 | from django.utils.copycompat import deepcopy |
7 | 7 | from django.utils.datastructures import SortedDict |
8 | 8 | from django.utils.html import conditional_escape |
| 9 | from django.utils.translation import ugettext_lazy as _ |
9 | 10 | from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode |
10 | 11 | from django.utils.safestring import mark_safe |
11 | 12 | |
… |
… |
|
117 | 118 | Returns True if the form has no errors. Otherwise, False. If errors are |
118 | 119 | being ignored, returns False. |
119 | 120 | """ |
| 121 | if not self.fields: |
| 122 | if not self._errors: |
| 123 | self._errors = ErrorDict() |
| 124 | self._errors[NON_FIELD_ERRORS] = self.error_class([_(u'No data was submitted.')]) |
| 125 | |
120 | 126 | return self.is_bound and not bool(self.errors) |
121 | 127 | |
122 | 128 | def add_prefix(self, field_name): |