diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-02-05 22:16:51 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-02-05 22:16:51 +0000 |
commit | 18a8fcbfb545fb01f3654ff1811f54f7fad582b8 (patch) | |
tree | e455232126876d5d7231aefe8fe05e3f6a30bc9b | |
parent | 478f8b9ea149e73cb25b918b1fec77e36a6b0737 (diff) | |
download | troggle-18a8fcbfb545fb01f3654ff1811f54f7fad582b8.tar.gz troggle-18a8fcbfb545fb01f3654ff1811f54f7fad582b8.tar.bz2 troggle-18a8fcbfb545fb01f3654ff1811f54f7fad582b8.zip |
restore crash to try to debug
-rw-r--r-- | core/models/caves.py | 10 | ||||
-rw-r--r-- | core/views/uploads.py | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index c61eb3c..0b11926 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -725,7 +725,7 @@ def GetCaveLookup(): if Gcave_count[c] > 1: message = f" ** Duplicate cave id count={Gcave_count[c]} id:'{Gcavelookup[c]}' cave __str__:'{c}'" print(message) - DataIssue.objects.update_or_create(parser="aliases", message=message) + update_dataissue("aliases", message) return Gcavelookup @@ -733,9 +733,11 @@ def GetCaveLookup(): def update_dataissue(parsercode, message): try: DataIssue.objects.update_or_create(parser=parsercode, message=message) - except DataError: - # bollocks, swallow this. - pass + except DataError as e: + # bollocks, swallow this.DANGEROUS. Assuming this is the + # (1406, "Data too long for column 'message' at row1") + # fault in the mariaDb/Django setup. + raise except: # Complete bollocks, but MariaDB barfs when it shouldn't : Django 3.2 issues = DataIssue.objects.filter(parser=parsercode, message=message) diff --git a/core/views/uploads.py b/core/views/uploads.py index 5fa7d3b..dd5d25d 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -193,7 +193,8 @@ def logbookedit(request, year=None, slug=None): else: year = slug[0:4] try: - year = str(int(year)) + year = str(int(year)) # but maybe slug was hand-edited to be a future year.. + year = validate_year(year) # so fix that except: year = current_expo() |