diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-07-25 21:07:13 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-07-25 21:07:13 +0300 |
commit | af552a3d62aa4b3489f3c600cb30b5ef2f5c6b7c (patch) | |
tree | 0bcb14380b4d956bfdef8311a28733df7de06f84 /core/views/scans.py | |
parent | 5ce21564fcb0ca5d3134aa57bc2504a28983edbf (diff) | |
download | troggle-af552a3d62aa4b3489f3c600cb30b5ef2f5c6b7c.tar.gz troggle-af552a3d62aa4b3489f3c600cb30b5ef2f5c6b7c.tar.bz2 troggle-af552a3d62aa4b3489f3c600cb30b5ef2f5c6b7c.zip |
better detect unknown cave identifer strings from users
Diffstat (limited to 'core/views/scans.py')
-rw-r--r-- | core/views/scans.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/views/scans.py b/core/views/scans.py index 7f9d8c7..83d6ac3 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -233,14 +233,19 @@ def cavewallets(request, caveid): for z in zilchwallets: zcaveid = z.cave() if zcaveid: - if str(zcaveid) in Gcavelookup: - fcave = Gcavelookup[str(zcaveid)] + cleanid = str(zcaveid).strip("'[]'") + if cleanid in Gcavelookup: + fcave = Gcavelookup[cleanid] if str(fcave.slug()) == caveid: # print(f' - Found one ! {z.walletname=} {zcaveid=}') wallets.add(z) + elif cleanid in ['surface', 'unknown', '']: + message = f" ! In {z.walletname} ignore '{cleanid}' " + print(message) + pass else: wurl = f"/walletedit/{z.walletname.replace('#',':')}" - message = f" ! In {z.walletname} there is an unrecognised cave name '{zcaveid}' (out of {len(Gcavelookup):,} cave names and aliases)" + message = f" ! In {z.walletname} there is an unrecognised cave name '{cleanid}' (out of {len(Gcavelookup):,} cave names and aliases)" print(message) DataIssue.objects.update_or_create(parser="scans", message=message, url=wurl) |