--
Ticket URL: <https://code.djangoproject.com/ticket/22261>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
The implementation is intended to match the catchall middleware.
We could try reversing and only if that fails fall back to the current
logic.
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:1>
* owner: nobody => edanm
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:2>
* has_patch: 0 => 1
Comment:
I just sent a pull request for a fix for this:
https://github.com/django/django/pull/2554
This solves all the cases I can think of for including flatpages and
running get_absolute_url() on them.
By the way, not sure if this is relevant, but:
When I was writing the tests for this, I noticed that all the flatpages
tests include the flatpages url without a slash, e.g.:
url(r'^flatpage_root', include('django.contrib.flatpages.urls')), (Note
lack of '/' after flatpage_root).
This is different than how the documentation recommends including the
flatpages, and doesn't make much sense. Not sure what the purpose of this
is.
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:3>
* cc: edanm (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:4>
* needs_better_patch: 0 => 1
Comment:
I left comments for improvement on the PR. Please uncheck "Patch needs
improvement" when you update it, thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:5>
Old description:
> The FlatPage model implements get_absolute_url without using reverse. The
> comment suggests, that this handles SCRIPT_NAME issues, but the link in
> the admin interface does not work, if you are using a prefix for the
> flatpages urls. The templatetag for resolving a flatpage works just fine.
New description:
The FlatPage model implements `get_absolute_url()` without using
`reverse()`. The comment suggests, that this handles `SCRIPT_NAME` issues,
but the link in the admin interface does not work, if you are using a
prefix for the flatpages urls. The templatetag for resolving a flatpage
works just fine.
--
Comment (by Tim Graham):
#28118 is a duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:6>
* owner: edanm => Hasan Ramezani
* needs_better_patch: 1 => 0
Comment:
I created another [https://github.com/django/django/pull/12148 PR] based
on the [https://github.com/django/django/pull/2554 first PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:7>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"e2fab0b6795f12a175ccdb412bb010f9d00c5a91" e2fab0b]:
{{{
#!CommitTicketReference repository=""
revision="e2fab0b6795f12a175ccdb412bb010f9d00c5a91"
Refs #22261 -- Added missing trailing slash to the flatpages_tests urls.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"2633c5341e94083dd802c5961b97b048adbd5940" 2633c534]:
{{{
#!CommitTicketReference repository=""
revision="2633c5341e94083dd802c5961b97b048adbd5940"
Fixed #22261 -- Fixed resolving namespaced URLs for flatpages.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:9>