Filter for enabled accounts
This commit is contained in:
parent
6ff5f718ba
commit
6464b6de05
|
@ -113,6 +113,11 @@ class StrategyForm(RestrictedFormMixin, ModelForm):
|
|||
"trend_signals": {"type": "trend"},
|
||||
}
|
||||
|
||||
# Filter for enabled accounts
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(StrategyForm, self).__init__(*args, **kwargs)
|
||||
self.fields["account"].queryset = Account.objects.filter(enabled=True)
|
||||
|
||||
class Meta:
|
||||
model = Strategy
|
||||
fields = (
|
||||
|
|
Loading…
Reference in New Issue