Code

Ticket #15754: widgets.diff

File widgets.diff, 634 bytes (added by sakkada, 3 years ago)
Line 
1Index: forms/widgets.py
2===================================================================
3--- forms/widgets.py    Tue Apr 05 20:48:33 2011 +0400
4+++ forms/widgets.py    Tue Apr 05 20:49:09 2011 +0400
5@@ -97,10 +97,7 @@
6 def media_property(cls):
7     def _media(self):
8         # Get the media property of the superclass, if it exists
9-        if hasattr(super(cls, self), 'media'):
10-            base = super(cls, self).media
11-        else:
12-            base = Media()
13+        base = getattr(super(cls, self), 'media', None) or Media()
14 
15         # Get the media definition for this class
16         definition = getattr(cls, 'Media', None)