mirror of https://github.com/django/django.git
Fixed #15754 -- avoid recursively computing the tree of media widgets more times than is necessary for a wiget
This commit is contained in:
parent
ad237fb72f
commit
ede49c7ee0
|
@ -110,9 +110,10 @@ class Media(StrAndUnicode):
|
||||||
def media_property(cls):
|
def media_property(cls):
|
||||||
def _media(self):
|
def _media(self):
|
||||||
# Get the media property of the superclass, if it exists
|
# Get the media property of the superclass, if it exists
|
||||||
if hasattr(super(cls, self), 'media'):
|
sup_cls = super(cls, self)
|
||||||
base = super(cls, self).media
|
try:
|
||||||
else:
|
base = sup_cls.media
|
||||||
|
except AttributeError:
|
||||||
base = Media()
|
base = Media()
|
||||||
|
|
||||||
# Get the media definition for this class
|
# Get the media definition for this class
|
||||||
|
|
Loading…
Reference in New Issue