* Go to /view/
* If a dirty bit is set, redirect to /update/ and remove the dirty bit
* Redirect back to /view/
The loop detection erroneously considers this a redirect loop because
/view/ is visited twice. Browsers don't have a problem with our redirects.
I propose that the redirect loop detection should check that a previous
site has been visited N times (for some value of N) before reporting a
redirect loop. If this sounds reasonable, I can create a patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/24713>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* severity: Normal => Release blocker
* needs_tests: => 0
* needs_docs: => 0
Comment:
Yes, it does seem reasonable.
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:1>
* status: new => assigned
* owner: nobody => MounirMesselmeni
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:2>
Comment (by MounirMesselmeni):
Please review my [https://github.com/django/django/pull/4591 PullRequest]
and check if we raise the RedirectCycleError when redirecting to the same
page more than 2 time is okay or we need to make it greater.
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:3>
* status: assigned => new
* owner: MounirMesselmeni =>
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:4>
* has_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:5>
Comment (by timgraham):
From Mounir on the pull request:
I don't think making multiple redirects for a client is the right way.
Let take an example: A user is trying to access a home page "/home" and
the server need to update an information, let's say a last_visit datetime
field or something else -- do we need to redirect him to "/update" make
this update and redirect him again to "/home"? I think it's better to run
a signal, an asynchronous task, make the update by calling a model method
or something else or even do the logic from the "/home" view. If we are
not sure that this is a common issue for many (now it look like only one
person have this problem) I think it's better to keep things like they
are.
I'd agree with this. Is there a reason you can't restructure your code to
avoid the redirect? See also the [https://groups.google.com/d/topic
/django-developers/8oXwD_KGjvc/discussion discussion on the django-
developers mailing list].
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:6>
* status: new => closed
* resolution: => wontfix
--
Ticket URL: <https://code.djangoproject.com/ticket/24713#comment:7>