From dc840c9bc773fa848e8903d65e657333c3ad2cd2 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 26 Apr 2021 18:11:14 +0100 Subject: tunnelpath to dwgpath --- core/views/surveys.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/views/surveys.py') diff --git a/core/views/surveys.py b/core/views/surveys.py index d149d4e..cf18fdd 100644 --- a/core/views/surveys.py +++ b/core/views/surveys.py @@ -59,12 +59,12 @@ def dwgfilesingle(request, path): but it might be a Therion file ''' try: - dwgfile = DrawingFile.objects.get(tunnelpath=urlunquote(path)) + dwgfile = DrawingFile.objects.get(dwgpath=urlunquote(path)) except: message = f'Drawing file error or not found \'{path}\' .' return render(request, 'errors/generic.html', {'message': message}) - tfile = Path(settings.TUNNEL_DATA, dwgfile.tunnelpath) + tfile = Path(settings.TUNNEL_DATA, dwgfile.dwgpath) try: # for display not download return HttpResponse(content=open(tfile, errors='strict'), content_type="text/xhtml") except UnicodeDecodeError: @@ -82,11 +82,11 @@ def dwgfileupload(request, path): '''uploads a drawing file, but where is the Form? This just processes POST info. Apparently unfinished? ''' try: - dwgfile = DrawingFile.objects.get(tunnelpath=urlunquote(path)) # need to check if inavlid query string and produce friendly error + dwgfile = DrawingFile.objects.get(dwgpath=urlunquote(path)) # need to check if inavlid query string and produce friendly error except: message = f'Drawing file error or not found \'{path}\' .' return render(request, 'errors/generic.html', {'message': message}) - tfile = Path(settings.TUNNEL_DATA, dwgfile.tunnelpath) + tfile = Path(settings.TUNNEL_DATA, dwgfile.dwgpath) project, user, password, tunnelversion = request.POST["tunnelproject"], request.POST["tunneluser"], request.POST["tunnelpassword"], request.POST["tunnelversion"] print(project, user, tunnelversion) -- cgit v1.2.3