Ticket #16129: patch.diff
File patch.diff, 1.2 KB (added by , 13 years ago) |
---|
-
django/views/generic/edit.py
1 1 from django.forms import models as model_forms 2 2 from django.core.exceptions import ImproperlyConfigured 3 from django. http import HttpResponseRedirect3 from django.shortcuts import redirect 4 4 from django.views.generic.base import TemplateResponseMixin, View 5 5 from django.views.generic.detail import (SingleObjectMixin, 6 6 SingleObjectTemplateResponseMixin, BaseDetailView) … … 57 57 return url 58 58 59 59 def form_valid(self, form): 60 return HttpResponseRedirect(self.get_success_url())60 return redirect(self.get_success_url()) 61 61 62 62 def form_invalid(self, form): 63 63 return self.render_to_response(self.get_context_data(form=form)) … … 212 212 def delete(self, request, *args, **kwargs): 213 213 self.object = self.get_object() 214 214 self.object.delete() 215 return HttpResponseRedirect(self.get_success_url())215 return redirect(self.get_success_url()) 216 216 217 217 # Add support for browsers which only accept GET and POST for now. 218 218 def post(self, *args, **kwargs):