Opened 14 months ago
Closed 14 months ago
#35725 closed Bug (needsinfo)
Flatpage's get_absolute_url Throws a Regex Tantrum
| Reported by: | Jason Cameron | Owned by: | Jason Cameron |
|---|---|---|---|
| Component: | contrib.flatpages | Version: | 5.1 |
| Severity: | Normal | Keywords: | |
| Cc: | Jason Cameron | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
FlatPages' get_absolute_url is encountering a regex error, affecting both the "view on site" feature and the django.contrib.flatpages.sitemaps.FlatPageSitemap. The following error is observed:
Exception Value: redefinition of group name 'url' as group 2; was group 1 at position 17
This issue stems from the following line (L46) in django\contrib\flatpages\models.py:
return reverse(flatpage, kwargs={"url": url})
Replacing this line with the following seemingly resolves the issue:
return reverse(flatpage, args=(url,))
Change History (3)
comment:1 by , 14 months ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:2 by , 14 months ago
comment:3 by , 14 months ago
| Resolution: | → needsinfo |
|---|---|
| Status: | assigned → closed |
Hi Jason, I can see inside django.contrib.contenttypes.views.shortcut it calls the get_absolute_url for the FlatPage object. In order to be able to replicate this, I need to know the url of that specific object. Can you find that out and let us know?
Here is a full traceback of it. https://project-metropolis.sentry.io/share/issue/4ee5940a0f6646d38732140ee87ba6c6/