Ticket #14363: patch.diff

File patch.diff, 788 bytes (added by tyrion, 5 years ago)
  • django/contrib/admin/widgets.py

    # HG changeset patch
    # User tyrion
    # Date 1285855227 -7200
    # Node ID 3e9be9623c609616b53e56e47b703d6d1506096a
    # Parent  203bd55e900832f6b6ced8e7499eabe26e43d06b
    Setting ManyToManyRawIdWidget.render `attrs` param to an empty dict if it's None.
    
    diff -r 203bd55e9008 -r 3e9be9623c60 django/contrib/admin/widgets.py
    a b  
    167167        super(ManyToManyRawIdWidget, self).__init__(rel, attrs, using=None)
    168168
    169169    def render(self, name, value, attrs=None):
     170        if attrs is None:
     171            attrs = {}
    170172        attrs['class'] = 'vManyToManyRawIdAdminField'
    171173        if value:
    172174            value = ','.join([force_unicode(v) for v in value])
Back to Top