mirror of
https://github.com/django/django.git
synced 2025-10-27 23:56:08 +00:00
Fixed #15754 -- avoid recursively computing the tree of media widgets more times than is necessary for a wiget
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user