mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 07:11:52 +00:00
Fix to not create an extra wallet
This commit is contained in:
parent
587ccff501
commit
5ae37eef82
@ -274,7 +274,9 @@ def walletedit(request, path=None):
|
|||||||
actual_saved = []
|
actual_saved = []
|
||||||
|
|
||||||
def get_next_empty():
|
def get_next_empty():
|
||||||
latest = Wallet.objects.filter(walletname__startswith="20").latest('walletname')
|
"""Gets the next most number for a new wallet just after the most recent one in the
|
||||||
|
db. But if it has no date set, then ignore it as it was only just created"""
|
||||||
|
latest = Wallet.objects.filter(walletname__startswith="20",walletdate__isnull=False).latest('walletname')
|
||||||
next = int(latest.walletname[5:]) + 1
|
next = int(latest.walletname[5:]) + 1
|
||||||
return f"{latest.walletname[:4]}:{next:02d}"
|
return f"{latest.walletname[:4]}:{next:02d}"
|
||||||
|
|
||||||
@ -456,6 +458,7 @@ def walletedit(request, path=None):
|
|||||||
form = FilesForm()
|
form = FilesForm()
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
|
# print(f'--- POST processing starts {wallet=} {path=}')
|
||||||
if "psg" in request.POST: # handle metadata form
|
if "psg" in request.POST: # handle metadata form
|
||||||
formj = WalletForm(request.POST)
|
formj = WalletForm(request.POST)
|
||||||
# Beware. All fields returned as strings. Must re-type them as lists etc. before using or re-saving
|
# Beware. All fields returned as strings. Must re-type them as lists etc. before using or re-saving
|
||||||
|
Loading…
Reference in New Issue
Block a user