aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/Dawn/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py
index f6078735..daed2bba 100644
--- a/python/Dawn/views.py
+++ b/python/Dawn/views.py
@@ -108,9 +108,12 @@ def get_form(trade, kind):
form = Form(trade_date = today.date(),
settle_date = today.date() + 3 * bus_day)
#add extra empty fields
+ empty_choice = (None, '')
for attr in ['folder', 'buysell', 'asset_class', 'swaption_type']:
try:
- getattr(form, attr).choices.insert(0, (None, ''))
+ dropdown = getattr(form, attr)
+ if dropdown.choices[0] != empty_choice:
+ dropdown.choices.insert(0, empty_choice)
except AttributeError:
continue
return form