diff options
Diffstat (limited to 'python/Dawn/views.py')
| -rw-r--r-- | python/Dawn/views.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py index 68161bdf..2f7292cc 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -244,23 +244,13 @@ def get_form(trade, kind): upfront_settle_date=today.date() + 1 * bus_day, ) - form.account_code.choices = fcm_accounts() - form.portfolio.choices = [ - c for c in form.portfolio.choices if c[0] not in ("IR", "IG", "HY") - ] - form.folder.choices = [ - c - for c in form.folder.choices - if (not c[0].startswith("SER_") or c[0].endswith("CURVE")) - ] - elif kind == "swaption": form = Form( trade_date=today.date(), effective_date=tomorrow.date(), settle_date=today.date() + 3 * bus_day, ) - form.portfolio.choices = [("OPTIONS", "OPTIONS"), ("IR", "IR")] + else: form = Form(trade_date=today.date(), settle_date=today.date() + 2 * bus_day) # add extra empty fields @@ -272,6 +262,20 @@ def get_form(trade, kind): dropdown.choices.insert(0, empty_choice) except AttributeError: continue + + if kind == "cds": + form.account_code.choices = fcm_accounts() + form.portfolio.choices = [ + c for c in form.portfolio.choices if c[0] not in ("IR", "IG", "HY") + ] + form.folder.choices = [ + c + for c in form.folder.choices + if (not c[0].startswith("SER_") or c[0].endswith("CURVE")) + ] + elif kind == "swaption": + form.portfolio.choices = [("OPTIONS", "OPTIONS"), ("IR", "IR")] + return form |
