mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 23:01: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 = []
|
||||
|
||||
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
|
||||
return f"{latest.walletname[:4]}:{next:02d}"
|
||||
|
||||
@ -456,6 +458,7 @@ def walletedit(request, path=None):
|
||||
form = FilesForm()
|
||||
|
||||
if request.method == "POST":
|
||||
# print(f'--- POST processing starts {wallet=} {path=}')
|
||||
if "psg" in request.POST: # handle metadata form
|
||||
formj = WalletForm(request.POST)
|
||||
# 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