summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/views/uploads.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py
index 136744b..5fa7d3b 100644
--- a/core/views/uploads.py
+++ b/core/views/uploads.py
@@ -252,7 +252,23 @@ def logbookedit(request, year=None, slug=None):
LogbookEntry.objects.filter(slug=slug).delete()
print(f"- Creating the LogBookEntry {slug}")
+ year = slug[0:4]
+ try:
+ expedition = Expedition.objects.get(year=year)
+ except Expedition.DoesNotExist:
+ message = f'''! - This expo "{year}" not created yet
+ It needs to be created before you can save a logbook entry.
+ See /handbook/computing/newyear.html
+
+ WHAT TO DO NOW:
+ 1. Press the Back button on your proswer to return to the screen where you typed up the entry,
+ 2. Copy the text of what you wrote into a new text file,
+ 3. Direct a nerd to fix this. It should take only a couple of minutes.'''
+ print(message)
+ return render(request, "errors/generic.html", {"message": message})
store_edited_entry_into_database(date, place, title, entry, others, author, tu, slug)
+
+
print(f"- Rewriting the entire {year} logbook to disc ")
filename= "logbook.html"
try: