[Django] #22261: Wrong Permalink for flatpages

17 views
Skip to first unread message

Django

unread,
Mar 12, 2014, 4:27:35 PM3/12/14
to django-...@googlegroups.com
#22261: Wrong Permalink for flatpages
-----------------------------------+--------------------
Reporter: allo@… | Owner: nobody
Type: Bug | Status: new
Component: contrib.flatpages | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/22261>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 20, 2014, 2:31:39 PM3/20/14
to django-...@googlegroups.com
#22261: Wrong Permalink for flatpages
-----------------------------------+------------------------------------

Reporter: allo@… | Owner: nobody
Type: Bug | Status: new
Component: contrib.flatpages | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by aaugustin):

* 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>

Django

unread,
Apr 14, 2014, 3:52:54 PM4/14/14
to django-...@googlegroups.com
#22261: Wrong Permalink for flatpages
-----------------------------------+------------------------------------
Reporter: allo@… | Owner: edanm
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by edanm):

* owner: nobody => edanm
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:2>

Django

unread,
Apr 14, 2014, 6:29:40 PM4/14/14
to django-...@googlegroups.com
#22261: Wrong Permalink for flatpages
-----------------------------------+------------------------------------
Reporter: allo@… | Owner: edanm
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by edanm):

* 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>

Django

unread,
Apr 15, 2014, 9:00:37 AM4/15/14
to django-...@googlegroups.com
#22261: Wrong Permalink for flatpages
-----------------------------------+------------------------------------
Reporter: allo@… | Owner: edanm
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by edanm):

* cc: edanm (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/22261#comment:4>

Django

unread,
Aug 13, 2014, 8:08:20 AM8/13/14
to django-...@googlegroups.com
#22261: Wrong Permalink for flatpages
-----------------------------------+------------------------------------
Reporter: allo@… | Owner: edanm
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by timgraham):

* 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>

Django

unread,
Aug 21, 2017, 7:36:15 AM8/21/17
to django-...@googlegroups.com
#22261: reverse() and get_absolute_url() may return different values for same
FlatPage

-----------------------------------+------------------------------------
Reporter: allo@… | Owner: edanm
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

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>

Django

unread,
Nov 26, 2019, 6:50:04 PM11/26/19
to django-...@googlegroups.com
#22261: reverse() and get_absolute_url() may return different values for same
FlatPage
-------------------------------------+-------------------------------------
Reporter: allo@… | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* 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>

Django

unread,
Jan 28, 2020, 7:44:58 AM1/28/20
to django-...@googlegroups.com
#22261: reverse() and get_absolute_url() may return different values for same
FlatPage
-------------------------------------+-------------------------------------
Reporter: allo@… | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: contrib.flatpages | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Jan 28, 2020, 7:44:58 AM1/28/20
to django-...@googlegroups.com
#22261: reverse() and get_absolute_url() may return different values for same
FlatPage
-------------------------------------+-------------------------------------
Reporter: allo@… | Owner: Hasan
| Ramezani
Type: Bug | Status: closed
Component: contrib.flatpages | Version: 1.6
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* 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>

Reply all
Reply to author
Forward
0 new messages