Ticket #14558: edit.py.diff

File edit.py.diff, 1.4 KB (added by pyrou, 5 years ago)
  • edit.py

     
    143143
    144144    # PUT is a valid HTTP verb for creating (with a known URL) or editing an
    145145    # object, note that browsers only support POST for now.
    146     put = post
     146    def put(self, *args, **kwargs):
     147        return self.post(*args, **kwargs)
    147148
    148149
    149150class BaseFormView(FormMixin, ProcessFormView):
     
    174175
    175176    # PUT is a valid HTTP verb for creating (with a known URL) or editing an
    176177    # object, note that browsers only support POST for now.
    177     put = post
     178    def put(self, *args, **kwargs):
     179        return self.post(*args, **kwargs)
    178180
    179181class CreateView(SingleObjectTemplateResponseMixin, BaseCreateView):
    180182    """
     
    200202
    201203    # PUT is a valid HTTP verb for creating (with a known URL) or editing an
    202204    # object, note that browsers only support POST for now.
    203     put = post
     205    def put(self, *args, **kwargs):
     206        return self.post(*args, **kwargs)
    204207
    205208
    206209class UpdateView(SingleObjectTemplateResponseMixin, BaseUpdateView):
     
    223226        return HttpResponseRedirect(self.get_success_url())
    224227
    225228    # Add support for browsers which only accept GET and POST for now.
    226     post = delete
     229    def post(self, *args, **kwargs):
     230        return self.delete(*args, **kwargs)
    227231
    228232    def get_success_url(self):
    229233        if self.success_url:
Back to Top