summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-05-01 18:35:08 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-05-01 18:35:08 +0100
commit3393db0fbc69556ad09a18b840b6cf10eaf4f52c (patch)
treeb7c47de8cf32958970759601499806b9cab489a2 /core
parent100209ea16ab7eec6e89d9e4935190e6c5ae4198 (diff)
downloadtroggle-3393db0fbc69556ad09a18b840b6cf10eaf4f52c.tar.gz
troggle-3393db0fbc69556ad09a18b840b6cf10eaf4f52c.tar.bz2
troggle-3393db0fbc69556ad09a18b840b6cf10eaf4f52c.zip
Bigger buttons, phone compatible
Diffstat (limited to 'core')
-rw-r--r--core/views/other.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/views/other.py b/core/views/other.py
index 0d096f2..c7d7eda 100644
--- a/core/views/other.py
+++ b/core/views/other.py
@@ -200,8 +200,7 @@ def ajax_test(request):
-class MyForm(forms.Form): # not a model-form
- title = forms.CharField(max_length=20)
+class MyForm(forms.Form): # not a model-form, just a form-form
scanfiles = forms.FileField()
@login_required_if_public
@@ -218,8 +217,13 @@ def scanupload(request, wallet=None):
wallet = "2021:01" # improve this later
year = wallet[:4]
+ if int(year) < 1977:
+ year = "1977"
+ if int(year) > 2050:
+ year = "2050"
nexty = f'{int(year)+1}'
prevy = f'{int(year)-1}'
+
wnumber = wallet[5:]
next = f'{int(wnumber)+1:02d}'
prev = f'{int(wnumber)-1:02d}'
@@ -235,11 +239,9 @@ def scanupload(request, wallet=None):
if request.method == 'POST':
form = MyForm(request.POST,request.FILES)
if form.is_valid():
- #form.save() # comment out so nothing saved in MEDIA_ROOT/fileuploads
f = request.FILES["scanfiles"]
- w = request.POST["title"]
multiple = request.FILES.getlist('scanfiles')
- fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, year, w))
+ fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, year, wallet))
actual_saved = []
if multiple: