Changes between Initial Version and Version 3 of Ticket #24962
- Timestamp:
- Jun 13, 2015, 7:37:32 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24962
- Property Needs tests unset
- Property Triage Stage Unreviewed → Accepted
-
Ticket #24962 – Description
initial v3 1 1 The admin list view of an object lists each object and does a 2 2 {{{ 3 3 reverse('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 }}} 5 5 to 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. 6 6 7 7 Therefore, a model like this: 8 8 {{{ 9 9 class Name(models.Model): 10 10 name = models.TextField(primary_key=True) 11 11 }}} 12 12 with: 13 {{{ 13 14 n = Name('John') 14 15 n.save() 15 16 o = Name('Have a \n newline') 16 17 o.save() 18 }}} 17 19 18 will list a link for John, but no link for 'Have a 19 newline' 20 will list a link for John, but no link for 'Have a newline' 20 21 21 22 (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)