#28883: uuid URL path converter failed if UUID is anything but lowercase
-----------------------------+-----------------------------------------
     Reporter:  Jean-Daniel  |                    Owner:  Daniel Leicht
         Type:  Bug          |                   Status:  assigned
    Component:  Core (URLs)  |                  Version:  2.0
     Severity:  Normal       |               Resolution:
     Keywords:  uuid         |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+-----------------------------------------

Comment (by Marten Kenbeek):

 The other converters accept upper- and lowercase, but they are not treated
 the same in general. E.g. DetailView does a case-sensitive lookup for the
 slug, so `/some-slug/` and `/Some-Slug/` do not refer to the same database
 object.

 You can quite easily override the UUID converter project-wide to accept
 upper- and lowercase UUIDs:

 {{{
 class CaseInsensitiveUUIDConverter(UUIDConverter):
     regex = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-
 fA-F]{4}-[0-9a-fA-F]{12}'

 register_converter(CaseInsensitiveUUIDConverter, 'uuid')
 }}}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.19e977dacf8499881d285fc36e0d6321%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to