Hide archived accounts in select for new statements
This commit is contained in:
parent
c6c67b9f93
commit
2cba5c6d83
1 changed files with 1 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
||||||
from account.models import Account
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from main.forms import NummiFileInput, NummiForm
|
from main.forms import NummiFileInput, NummiForm
|
||||||
|
@ -28,7 +27,7 @@ class StatementForm(NummiForm):
|
||||||
_user = kwargs.get("user")
|
_user = kwargs.get("user")
|
||||||
_disable_account = kwargs.pop("disable_account", False)
|
_disable_account = kwargs.pop("disable_account", False)
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.fields["account"].queryset = Account.objects.filter(user=_user)
|
self.fields["account"].queryset = _user.account_set.exclude(archived=True)
|
||||||
self.fields["transactions"] = forms.MultipleChoiceField(
|
self.fields["transactions"] = forms.MultipleChoiceField(
|
||||||
choices=(
|
choices=(
|
||||||
((_transaction.id), _transaction)
|
((_transaction.id), _transaction)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue