Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#28966 closed Cleanup/optimization (fixed)

Document that the UUID URL path converter requires dashes

Reported by: Jahongir Owned by: nobody
Component: Documentation Version: 2.0
Severity: Normal Keywords: urls
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have this url path:

path('driver/<uuid:driver_guid>/logs/', views.LogListView.as_view(), name='list-logs'),

If I try this: reverse('list-logs', kwargs={'driver_guid': '3d2dde2ef06d465283c8849e9eba7bae'}), it does not find the path because the guid does not have '-'.

If I try reverse('list-logs', kwargs={'driver_guid': '3d2dde2e-f06d-4652-83c8-849e9eba7bae'}) it does work.

The problem is that 3d2dde2ef06d465283c8849e9eba7bae is also a valid uuid.

I think it should be recognized as well.

Change History (3)

comment:1 by Tim Graham, 6 years ago

Component: Core (URLs)Documentation
Has patch: set
Summary: GUID without "-" is not recognized by url pathDocument that the UUID URL path converter requires dashes
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

I think the same rationale as #28883 (only lower case letters are accepted) applies here as well. PR to document that rationale a bit more.

comment:2 by GitHub <noreply@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 038ea4f:

Fixed #28966 -- Doc'd that the uuid URL path converter requires dashes

comment:3 by Tim Graham <timograham@…>, 6 years ago

In 1b27374b:

[2.0.x] Fixed #28966 -- Doc'd that the uuid URL path converter requires dashes

Backport of 038ea4f8593618cf0f408f15f756f2145de0d40e from master

Note: See TracTickets for help on using tickets.
Back to Top