Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #15754 -- avoid recursively computing the tree of media widgets…

… more times than is necessary for a wiget
  • Loading branch information...
commit ede49c7ee03dd1519d0c375d953cb73e106837b6 1 parent ad237fb
@alex alex authored Alex Gaynor committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/forms/widgets.py
View
7 django/forms/widgets.py
@@ -110,9 +110,10 @@ def __add__(self, other):
def media_property(cls):
def _media(self):
# Get the media property of the superclass, if it exists
- if hasattr(super(cls, self), 'media'):
- base = super(cls, self).media
- else:
+ sup_cls = super(cls, self)
+ try:
+ base = sup_cls.media
+ except AttributeError:
base = Media()
# Get the media definition for this class
Please sign in to comment.
Something went wrong with that request. Please try again.