Changes between Initial Version and Version 3 of Ticket #24962


Ignore:
Timestamp:
Jun 13, 2015, 7:37:32 PM (9 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24962

    • Property Needs tests unset
    • Property Triage Stage UnreviewedAccepted
  • Ticket #24962 – Description

    initial v3  
    11The admin list view of an object lists each object and does a
    2 
     2{{{
    33reverse('admin:%s_%s_change' % (self.opts.app_label, self.opts.model_name), args=(quote(pk),), current_app=self.model_admin.admin_site.name)
    4 
     4}}}
    55to assign a change url for each one, skipping the link if the reverse fails. The 'quote' function there escapes a whole bunch of characters so as not to confuse the url pattern matcher but it forgets to escape newline.
    66
    77Therefore, a model like this:
    8 
     8{{{
    99class Name(models.Model):
    1010   name = models.TextField(primary_key=True)
    11 
     11}}}
    1212with:
     13{{{
    1314n = Name('John')
    1415n.save()
    1516o = Name('Have a \n newline')
    1617o.save()
     18}}}
    1719
    18 will list a link for John, but no link for 'Have a
    19 newline'
     20will list a link for John, but no link for 'Have a newline'
    2021
    2122(The bug actually is triggered in quite a few other places in admin but the list view is the easiest one to see. I've attached some screenshots that I prepared earlier)
Back to Top