Skip to content

Commit

Permalink
修复AdminSplitDateTime IndexError
Browse files Browse the repository at this point in the history
  • Loading branch information
Li Dongyong committed Mar 16, 2018
1 parent 0a382bd commit 515ee22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xadmin/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def __init__(self, attrs=None):

def render(self, name, value, attrs=None):
if DJANGO_11:
input_html = [ht for ht in super(AdminSplitDateTime, self).render(name, value, attrs).split('\n') if ht != '']
input_html = [ht for ht in super(AdminSplitDateTime, self).render(name, value, attrs).replace(
'/><input', '/>\n<input').split('\n') if ht != '']
# return input_html
return mark_safe('<div class="datetime clearfix"><div class="input-group date bootstrap-datepicker"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>%s'
'<span class="input-group-btn"><button class="btn btn-default" type="button">%s</button></span></div>'
Expand Down

0 comments on commit 515ee22

Please sign in to comment.