Return the URL to redirect to after processing a valid form.
(self)
| 115 | return kwargs |
| 116 | |
| 117 | def get_success_url(self): |
| 118 | """Return the URL to redirect to after processing a valid form.""" |
| 119 | if self.success_url: |
| 120 | url = self.success_url.format(**self.object.__dict__) |
| 121 | else: |
| 122 | try: |
| 123 | url = self.object.get_absolute_url() |
| 124 | except AttributeError: |
| 125 | raise ImproperlyConfigured( |
| 126 | "No URL to redirect to. Either provide a url or define" |
| 127 | " a get_absolute_url method on the Model." |
| 128 | ) |
| 129 | return url |
| 130 | |
| 131 | def form_valid(self, form): |
| 132 | """If the form is valid, save the associated model.""" |
nothing calls this directly
no test coverage detected