diff options
Diffstat (limited to 'core/views/uploads.py')
-rw-r--r-- | core/views/uploads.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py index c58bc65..0ad168c 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -306,7 +306,8 @@ def logbookedit(request, year=None, slug=None): place = request.POST["place"].strip().replace(' - ',' = ') # no hyphens ! title = request.POST["title"].strip() entry = request.POST["text"].strip() - slug = request.POST["slug"].strip() + if "slug" in request.POST: + slug = request.POST["slug"].strip() # if we are re-editing the same entry again entry = entry.replace('\r','') # remove HTML-standard CR inserted from form. entry = entry.replace('\n\n','\n<p>\n') # replace 2 \n with <br><br> # entry = entry.replace('\n\n','\n<br />\n<br />\n') # replace 2 \n with <br><br> @@ -334,7 +335,7 @@ def logbookedit(request, year=None, slug=None): authorflag = True print(f"! Unrecognised author: {author}") - + # slug is set either because we already posted or because it was specified inthe url if not slug: # Creating a new logbook entry with all the gubbins slug = create_new_lbe_slug(date) |