diff options
Diffstat (limited to 'python/Dawn')
| -rw-r--r-- | python/Dawn/views.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py index dcc0e195..7b4fc8aa 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -316,14 +316,16 @@ def trade_manage(tradeid, kind): form = _get_form(kind)() form.cp_code.choices = form.cp_code.choices + list(cp_choices(kind)) - form.account_code.choices = list(fcm_accounts()) + if kind == 'cds': + form.account_code.choices = list(fcm_accounts()) if kind == 'bond': old_ticket_name = trade.ticket if kind == 'capfloor': old_confirm = trade.trade_confirm if form.validate_on_submit(): form.populate_obj(trade) - trade.cashaccount = trade.fcm_account.cash_account + if kind == 'cds': + trade.cashaccount = trade.fcm_account.cash_account session = form.get_session() if not tradeid: session.add(trade) @@ -349,7 +351,8 @@ def trade_manage(tradeid, kind): app.logger.error(form.errors) form = get_form(trade, kind) form.cp_code.choices = form.cp_code.choices + list(cp_choices(kind)) - form.account_code.choices = list(fcm_accounts()) + if kind == 'cds': + form.account_code.choices = list(fcm_accounts()) return render_template('trade_entry.html', form=form, action_url=url_for('trade_manage', tradeid=tradeid, kind=kind)) |
