summaryrefslogtreecommitdiffstats
path: root/core/views/uploads.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/uploads.py')
-rw-r--r--core/views/uploads.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py
index 0be3d35..e7675b8 100644
--- a/core/views/uploads.py
+++ b/core/views/uploads.py
@@ -64,9 +64,13 @@ def logbookedit(request, year=None, slug=None):
"""Edit a logbook entry
This is daft: we have the parsed identity of the person and we render it to text as 'fullname', to be re-parsed on re-importing.
And there is no guarantee that this will be the same thing, esp. as aliases are used in the initial data input.
+
So we are losing all the cute aliases that have been used over the years by this export/re-import process. Bother.
But they have already been lost in the Great Format Conversion of 2022-23 when everything was chnaged to use the same HTML parser.
Which is a shame.
+ Fix is to add "alias_used" as a field in class PersonLogEntry, so that we can preserve
+ all those cute names. But it's rather a large manual effort (with some scripting) to recover the aliases from the original logbook
+ html files which are now only in the git history. Bother. Very sorry.
"""
def clean_tu(tu):
if tu =="":
@@ -81,8 +85,10 @@ def logbookedit(request, year=None, slug=None):
"""This gives each logbook entry a unique id based on the date+content, so the order of entries on a particular day
does not matter. This is a change (August 2023) from previous process.
Otherwise we could get 2023-07-20a and 2023-07-20b swapped on exporting and re-importing logbooks
- because the database does not record precendence.
- 2 hex digits would seem adequate for each expo day, but we might get a collision..
+ because the database does not record precedence.
+ 2 hex digits would seem adequate for each expo day, but we might get a collision.
+ The hash is based on the content after substitution of <p> so should be stable. Which means these ids
+ can be used elsewhere in the troggle system as permanent slugs.
"""
sha.update(text.encode('utf-8'))
return sha.hexdigest()[0:n]