Skip to content

Commit

Permalink
fixed init function of image widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Lorenz committed Nov 12, 2016
1 parent 95ca2cc commit e173942
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- prepared app for Django 1.9 and Python 3.5
- dropped support for Django<1.6
- Removed deprecated stuff and updated docs
- fixed init function of image widget

=== 1.66.X ===

Expand Down
2 changes: 1 addition & 1 deletion django_libs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '1.67.7'
__version__ = '1.67.8'
5 changes: 4 additions & 1 deletion django_libs/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class LibsImageWidget(widgets.ClearableFileInput):
template_path = 'django_libs/partials/libs_image_widget.html'

def __init__(self, attrs=None):
self.classes = attrs.get('class', '')
if attrs:
self.classes = attrs.get('class', '')
else:
self.classes = ''
super(LibsImageWidget, self).__init__(attrs)

def render(self, name, value, attrs=None):
Expand Down

0 comments on commit e173942

Please sign in to comment.