diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-04-23 03:07:21 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-04-23 03:07:21 +0100 |
commit | dbd186e299fecd8f10f3dca0a88b78f842b0c59b (patch) | |
tree | cf90218918c0896ad770bcceb69f1e7df0d8c097 /core/views/other.py | |
parent | 1a4be0f02e8ca2536bb754c7285c005478ad047a (diff) | |
download | troggle-dbd186e299fecd8f10f3dca0a88b78f842b0c59b.tar.gz troggle-dbd186e299fecd8f10f3dca0a88b78f842b0c59b.tar.bz2 troggle-dbd186e299fecd8f10f3dca0a88b78f842b0c59b.zip |
make ?reload private and clean old error msgs
Diffstat (limited to 'core/views/other.py')
-rw-r--r-- | core/views/other.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/views/other.py b/core/views/other.py index 639ea5f..9a12b1d 100644 --- a/core/views/other.py +++ b/core/views/other.py @@ -41,11 +41,15 @@ def todos(request, module): ''' from troggle.core.TESTS.tests import todo as tests from troggle.core.views.logbooks import todo as viewlogbooks + from troggle.parsers.logbooks import todo as parserslogbooks from troggle.core.forms import todo as forms + from troggle.core.templatetags.wiki_markup import todo as wiki tododict = {'views/other': todo, 'tests': tests, 'views/logbooks': viewlogbooks, - 'core/forms': forms} + 'parsers/logbooks': parserslogbooks, + 'core/forms': forms, + 'core/templatetags/wiki_markup': wiki} return render(request,'core/todos.html', {'tododict': tododict}) def troggle404(request): # cannot get this to work. Handler404 in urls.py not right syntax @@ -215,25 +219,25 @@ def newfile(request, pslug = None): return render(request, 'editfile.html', {'fileForm': fileform, }) @login_required_if_public -def simpleupload(request): - print(f'! - FORM simpleupload - start') +def scanupload(request, year='2050'): + print(f'! - FORM scanupload - start') if request.method == 'POST': form = SimpleUploadFileForm(request.POST,request.FILES) if form.is_valid(): #form.save() # comment out so nothing saved in MEDIA_ROOT/fileuploads f = request.FILES["simplefile"] w = request.POST["title"] - print(f'! - FORM simpleupload uploaded {f.name}') - fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, '2021', w)) + print(f'! - FORM scanupload uploaded {f.name}') + fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, year, w)) actual_saved = fs.save(f.name, content=f) # name may chnage to avoid clash - # INSERT check if name is chnaged, to allow user to abort and rename - or lets do a chaecjk anyway. + # INSERT check if name is changed, to allow user to abort and rename - or lets do a chaecjk anyway. - print(f'! - FORM simpleupload {actual_saved}') + print(f'! - FORM scanupload {actual_saved}') form = SimpleUploadFileForm() - return render(request, 'simpleupload.html', {'form': form,'filesaved': True, 'actual_saved': actual_saved}) + return render(request, 'scanuploadform.html', {'form': form,'filesaved': True, 'actual_saved': actual_saved}) else: form = SimpleUploadFileForm() - return render(request, 'simpleupload.html', {'form':form,}) + return render(request, 'scanuploadform.html', {'form':form,}) |