diff --git a/core/forms.py b/core/forms.py index b0f9231..418b6b4 100644 --- a/core/forms.py +++ b/core/forms.py @@ -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 = (