2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

re-enable login restriction on wallet create

This commit is contained in:
Philip Sargent 2023-03-22 15:04:34 +00:00
parent ead3f8dc8b
commit ad48851118

View File

@ -256,7 +256,7 @@ def get_complaints(complaints, waldata, svxfiles, files, wallet, wurl):
return complaints, caveobject return complaints, caveobject
# @login_required_if_public @login_required_if_public
def walletedit(request, path=None): def walletedit(request, path=None):
"""Create a new wallet or upload scanned image files into a wallet on /expofiles """Create a new wallet or upload scanned image files into a wallet on /expofiles
Also display AND EDIT the contents.json data in the wallet. Also display AND EDIT the contents.json data in the wallet.
@ -408,7 +408,9 @@ def walletedit(request, path=None):
# print(f'--- FINISHED saving to JSON at {contents_path}') # print(f'--- FINISHED saving to JSON at {contents_path}')
def make_wallet(walletname): def make_wallet(walletname):
"""We need a wallet Object so that the django template stuff can find the files""" """We need a wallet Object so that the django template stuff can find the files
BUT we must restrict this to logged-in users otherwise spiderbots get at
the hidden Submit button and create zillions of the buggers"""
try: try:
w, created = Wallet.objects.get_or_create(walletname=walletname) w, created = Wallet.objects.get_or_create(walletname=walletname)
# print(f"--- Wallet string {walletname}, wallet object {w} created new?: {created}") # print(f"--- Wallet string {walletname}, wallet object {w} created new?: {created}")