diff options
| author | Rohit <130643902+rohit10jr@users.noreply.github.com> | 2025-08-11 09:09:16 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-08-11 10:12:43 +0200 |
| commit | fa804d0d14ef4547b4fe2a88ab5d89d4eed5bacd (patch) | |
| tree | 72eba3c4bace4f03145e1efa35d1022157d8b396 /docs/topics/class-based-views | |
| parent | 7a80e29feaa675a27bf525164502ebc8ecbdce1a (diff) | |
Corrected code examples in topics docs.
Diffstat (limited to 'docs/topics/class-based-views')
| -rw-r--r-- | docs/topics/class-based-views/generic-editing.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/topics/class-based-views/generic-editing.txt b/docs/topics/class-based-views/generic-editing.txt index 73d1e2eb8d..24b617c418 100644 --- a/docs/topics/class-based-views/generic-editing.txt +++ b/docs/topics/class-based-views/generic-editing.txt @@ -303,7 +303,7 @@ preference, use :func:`django.http.HttpRequest.get_preferred_type`:: def form_invalid(self, form): response = super().form_invalid(form) - accepted_type = request.get_preferred_type(self.accepted_media_types) + accepted_type = self.request.get_preferred_type(self.accepted_media_types) if accepted_type == "text/html": return response elif accepted_type == "application/json": @@ -314,7 +314,7 @@ preference, use :func:`django.http.HttpRequest.get_preferred_type`:: # it might do some processing (in the case of CreateView, it will # call form.save() for example). response = super().form_valid(form) - accepted_type = request.get_preferred_type(self.accepted_media_types) + accepted_type = self.request.get_preferred_type(self.accepted_media_types) if accepted_type == "text/html": return response elif accepted_type == "application/json": |
