diff options
| author | Tobias Kunze <r@rixx.de> | 2019-04-16 09:24:48 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-04-16 09:24:48 +0200 |
| commit | d610521bffe9d44a070ebe3a719b474aff6d3d1e (patch) | |
| tree | dafd58d6793676363cade4bd895bd335205e20ff /docs | |
| parent | 516d858e7a3d01443cdc4e1eb4532b9d910f5e2b (diff) | |
Fixed #14009 -- Fixed custom formset validation example in docs.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/forms/formsets.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index b9c8721bf5..ddc97db3e5 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -274,7 +274,9 @@ is where you define your own validation that works at the formset level:: ... return ... titles = [] ... for form in self.forms: - ... title = form.cleaned_data['title'] + ... if self.can_delete and self._should_delete_form(form): + ... continue + ... title = form.cleaned_data.get('title') ... if title in titles: ... raise forms.ValidationError("Articles in a set must have distinct titles.") ... titles.append(title) |
