Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms-admin: Fixed a deepcopy bug in RelatedFieldWidgetWrapper. Th…

…is should probably be addressed in the base Widget class in trunk, but I'm not going to make that call. Refs #5505.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cb5dc33ce5a87caff9d6a4a7d770a2737db397ec 1 parent b94ae3b
@jkocherhans jkocherhans authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 django/contrib/admin/widgets.py
View
6 django/contrib/admin/widgets.py
@@ -1,6 +1,7 @@
"""
Form Widget classes specific to the Django admin site.
"""
+import copy
from django import newforms as forms
from django.utils.datastructures import MultiValueDict
@@ -131,3 +132,8 @@ def __call__(self, name, value, *args, **kwargs):
(related_url, name))
output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>' % settings.ADMIN_MEDIA_PREFIX)
return u''.join(output)
+
+ def __deepcopy__(self, memo):
+ # There is no reason to deepcopy self.admin_site, etc, so just return
+ # a shallow copy.
+ return copy.copy(self)
Please sign in to comment.
Something went wrong with that request. Please try again.