From 43af6dd9f95936284581275f3b762f81e032960b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 3 Apr 2014 13:42:20 +0200 Subject: Automatic copy of associated archaeological file on operation creation (refs #1745) --- ishtar_common/widgets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index fc3ada283..2105b73e3 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -211,8 +211,9 @@ class JQueryAutoComplete(forms.TextInput): selects.append("") attrs_select['value'] = ", ".join(selects) else: - attrs_hidden['value'] = hiddens[0] - attrs_select['value'] = selects[0] + if hiddens and selects: + attrs_hidden['value'] = hiddens[0] + attrs_select['value'] = selects[0] if not self.attrs.has_key('id'): attrs_hidden['id'] = 'id_%s' % name attrs_select['id'] = 'id_select_%s' % name -- cgit v1.2.3