﻿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
25997	Editing ForeignKey in admin popup causes incorrect escaping for uuid field	Zach Borboa	Sasha Gaevsky	"Editing and saving a model's foreign key causes the related field to display incorrectly.

Displays something like ""b71658a1\u002Df845\u002D4a44\u002D8085\u002D03034580ac72""
instead of ""b71658a1-f845-4a44-8085-03034580ac72""

Screenshot: https://i.imgur.com/Q5lrfV2.png

Reproduce:
1. Create new project using python3
$ mkvirtualenv --python=$(which python3) myproject && cd myproject
$ django-admin startproject mysite && cd mysite
$ python manage.py startapp polls

2. Add polls to INSTALLED_APPS

3. Set polls/models.py
{{{#!python
import uuid
from django.db import models

class Question(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    question_text = models.CharField(max_length=200)

    def __str__(self):
        return str(self.id)

class Choice(models.Model):
    question = models.ForeignKey(Question)
    choice_text = models.CharField(max_length=200)
}}}

4. Set polls/admin.py
{{{#!python
from django.contrib import admin

from .models import Choice
from .models import Question

admin.site.register(Choice)
admin.site.register(Question)
}}}

5. Go to the admin add page for Choice http://127.0.0.1:8000/admin/polls/choice/add/
6. Click the plus sign (""+"") next to the ""Question:"" label. Enter question text (like ""test"") and click save. The uuid is correctly displayed in the Question select box.
7. Click the pencil edit button next to the Question label. In the new popup window, click save. The uuid is no longer correctly displayed."	Bug	closed	contrib.admin	1.9	Release blocker	fixed			Accepted	1	0	0	0	0	0
