parent
748f9e5fb6
commit
d9304db43d
1 changed files with 8 additions and 2 deletions
|
@ -96,7 +96,10 @@ class TransactionCreateView(NummiCreateView):
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
return super().get_form_kwargs() | {
|
return super().get_form_kwargs() | {
|
||||||
"initial": {
|
"initial": {
|
||||||
"snapshot": self.kwargs.get("snapshot"),
|
"snapshot": (
|
||||||
|
self.kwargs.get("snapshot")
|
||||||
|
or Snapshot.objects.filter(user=self.request.user).first()
|
||||||
|
),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +131,10 @@ class SnapshotCreateView(NummiCreateView):
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
return super().get_form_kwargs() | {
|
return super().get_form_kwargs() | {
|
||||||
"initial": {
|
"initial": {
|
||||||
"account": self.kwargs.get("account"),
|
"account": (
|
||||||
|
self.kwargs.get("account")
|
||||||
|
or Account.objects.filter(user=self.request.user).first()
|
||||||
|
),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue