Skip to content

Commit

Permalink
Merge pull request sshwsfc#534 from Friday21/master
Browse files Browse the repository at this point in the history
修复AdminSplitDateTime IndexError
  • Loading branch information
wgbbiao authored Mar 22, 2018
2 parents e2b1977 + 515ee22 commit 697a658
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 697a658

Please sign in to comment.