diff options
Diffstat (limited to 'core/views/uploads.py')
-rw-r--r-- | core/views/uploads.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py index 860cba7..6b6161d 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -515,8 +515,13 @@ def scanupload(request, path=None): f = Path(settings.SURVEX_DATA) / svx if f.is_file(): path = svx.parent / svx.stem - #print(f' - {path=}') - svxfile = SurvexFile.objects.get(path=path) + #print(f' - {path=}') + try: + svxfile = SurvexFile.objects.get(path=path) + except: + message = f'Specified survex file not found - database apparently empty, you probably need to do a full re-import of all data.' + return render(request, 'errors/generic.html', {'message': message}) + print(f' - {svxfile=}') caves.append(svxfile.cave) caverefs.append(svxfile.cave.reference()) |