Ticket #16129: patch.diff

File patch.diff, 1.2 KB (added by renatopedigoni, 13 years ago)
  • django/views/generic/edit.py

     
    11from django.forms import models as model_forms
    22from django.core.exceptions import ImproperlyConfigured
    3 from django.http import HttpResponseRedirect
     3from django.shortcuts import redirect
    44from django.views.generic.base import TemplateResponseMixin, View
    55from django.views.generic.detail import (SingleObjectMixin,
    66                        SingleObjectTemplateResponseMixin, BaseDetailView)
     
    5757        return url
    5858
    5959    def form_valid(self, form):
    60         return HttpResponseRedirect(self.get_success_url())
     60        return redirect(self.get_success_url())
    6161
    6262    def form_invalid(self, form):
    6363        return self.render_to_response(self.get_context_data(form=form))
     
    212212    def delete(self, request, *args, **kwargs):
    213213        self.object = self.get_object()
    214214        self.object.delete()
    215         return HttpResponseRedirect(self.get_success_url())
     215        return redirect(self.get_success_url())
    216216
    217217    # Add support for browsers which only accept GET and POST for now.
    218218    def post(self, *args, **kwargs):
Back to Top