id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux
9211,Objects with newlines in representation break popup JavaScript in the admin,jbronn,nobody,"When you have these models:
{{{
class Note(models.Model):
text = models.TextField()
def __unicode__(self):
return self.text
class Person(models.Model):
name = models.CharField(max_length=25)
note = models.ForeignKey(Note)
def __unicode__(self):
return self.name
}}}
And the following in `admin.py`:
{{{
from django.contrib import admin
from models import Note, Person
admin.site.register(Note)
admin.site.register(Person)
}}}
When entering a `Person` model in the admin a new may `Note` created by clicking the plus icon next to the selection list. If the person entering the note presses return and puts newlines in the `TextField`, the `dismissAddAnotherPopup` JavaScript chokes on the `Notes` representation.
Attached is a patch that escapes carriage returns, however, I want some discussion on whether there needs to be any other escaping performed.",,closed,contrib.admin,1.0,,duplicate,admin popup newline carriage,,Accepted,0,0,0,0,,