I'd be happy to help and improve this part of Django, but I need some feedback from your side on the proposal above (and also how to improve it) to open a proper PR. Can you please give some? Il giorno giovedì 21 ottobre 2021 alle 08:58:06 UTC+2 Niccolò Mineo ha scritto:
> Ex. > > if self.response_gone_class != HttpResponseGone and r.new_path == '': > return self.response_gone_class() > if self.response_redirect_class != HttpResponsePermanentRedirect: > return self.response_redirect_class(r.new_path) > return HttpResponse(status_code=r.redirect_type, new_path=r.new_path) > > Il giorno giovedì 21 ottobre 2021 alle 08:56:44 UTC+2 Niccolò Mineo ha > scritto: > >> Elaborating on the original proposal to make it backwards compatible, I >> was thinking along the lines of checking in the middleware whether the >> response_redirect_class attribute is set with the default class and, if >> it is, making it use the Model's redirect_type field. For 410 status >> codes, the response_gone_class would be the attribute to check, of >> course. >> >> Il giorno sabato 16 ottobre 2021 alle 23:50:26 UTC+2 Niccolò Mineo ha >> scritto: >> >>> I just opened a ticket with the related PR: >>> https://code.djangoproject.com/ticket/33206 >>> >>> Il giorno mercoledì 6 ottobre 2021 alle 23:55:51 UTC+2 Adam Johnson ha >>> scritto: >>> >>>> This seems like a reasonable addition to me. >>>> >>>> On Fri, 24 Sept 2021 at 08:08, Niccolò Mineo <niccol...@gmail.com> >>>> wrote: >>>> >>>>> Hi. The marketing guys at my workplace asked for the ability to >>>>> customise the redirect type (301, 302) when creating redirects in the >>>>> admin and I shipped this change a while ago. I believe this could be a >>>>> nice >>>>> addition to Django itself, too. What do you think? >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Django developers (Contributions to Django itself)" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to django-develop...@googlegroups.com. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/django-developers/0ccdfe91-c97a-4363-9226-518310ceca04n%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/django-developers/0ccdfe91-c97a-4363-9226-518310ceca04n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1ad13f10-ea21-4d6e-b502-ea51bdfec48dn%40googlegroups.com.