summaryrefslogtreecommitdiffstats
path: root/core/views/other.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-04-20 22:58:41 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-04-20 22:58:41 +0100
commitb4ba3c40ebf26cae49e93f2aa6c2f1b6e8bc556e (patch)
tree7229549717eb2492dfb0afce5e42bd83f4dd231e /core/views/other.py
parent3b0c6ef2ea27fa2edbf5044f03e2dd3884ae54f5 (diff)
downloadtroggle-b4ba3c40ebf26cae49e93f2aa6c2f1b6e8bc556e.tar.gz
troggle-b4ba3c40ebf26cae49e93f2aa6c2f1b6e8bc556e.tar.bz2
troggle-b4ba3c40ebf26cae49e93f2aa6c2f1b6e8bc556e.zip
catch unknown scotsman error
Diffstat (limited to 'core/views/other.py')
-rw-r--r--core/views/other.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/core/views/other.py b/core/views/other.py
index 569264b..b179f82 100644
--- a/core/views/other.py
+++ b/core/views/other.py
@@ -134,14 +134,12 @@ def ajax_QM_number(request):
return HttpResponse(res)
-
-#print(" - newFile() is next in troggle/core/views/other.py")
-
@login_required_if_public
def newFile(request, pslug = None):
+ ''' not known quite what this was for or where it fits in - original 2006 troggle idea never finished?
+ '''
if pslug:
previousfile = LogbookEntry.objects.get(slug = pslug, date = previousdate, expedition = expedition)
- #assert previousfile.filename
if request.method == 'POST': # If the form has been submitted...
tripForm = TripForm(request.POST) # A form bound to the POST data
personTripFormSet = PersonTripFormSet(request.POST)
@@ -175,16 +173,4 @@ def newFile(request, pslug = None):
return render(request, 'editfile.html', {'fileForm': fileform, })
-@login_required_if_public
-def deleteFile(request, expeditionyear, date = None, slug = None):
- expedition = Expedition.objects.get(year=expeditionyear)
- previousdate = datetime.date(*[int(x) for x in date.split("-")])
- previouslbe = LogbookEntry.objects.get(slug = slug, date = previousdate, expedition = expedition)
- delLogbookEntry(previouslbe)
- return HttpResponseRedirect(reverse('expedition', args=[expedition.year])) # Redirect after POST
-
-def delFile(f):
- for pt in lbe.persontrip_set.all():
- pt.delete()
- lbe.delete()
- os.remove(lbe.filename)
+