1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Fixed #18906 -- Ignored to-be-deleted forms in formset validate_unique

Thanks c.pollock at bangor.ac.uk for the report.
This commit is contained in:
Claude Paroz
2013-02-08 21:30:06 +01:00
parent db09a2de6e
commit f44922c795
3 changed files with 23 additions and 23 deletions

View File

@@ -179,11 +179,10 @@ class BaseFormSet(object):
@property
def deleted_forms(self):
"""
Returns a list of forms that have been marked for deletion. Raises an
AttributeError if deletion is not allowed.
Returns a list of forms that have been marked for deletion.
"""
if not self.is_valid() or not self.can_delete:
raise AttributeError("'%s' object has no attribute 'deleted_forms'" % self.__class__.__name__)
return []
# construct _deleted_form_indexes which is just a list of form indexes
# that have had their deletion widget set to True
if not hasattr(self, '_deleted_form_indexes'):