summaryrefslogtreecommitdiffstats
path: root/core/views/uploads.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-08-10 23:36:56 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-08-10 23:36:56 +0300
commitc44dea4d2b245c1bc330120319417f438ec12cc3 (patch)
tree084f3c1b7c4eb6ce57663a53fb2f3ea3915e89bc /core/views/uploads.py
parent24b5018c8dbaf2e3710d965a8f4ee6411b67ed7a (diff)
downloadtroggle-c44dea4d2b245c1bc330120319417f438ec12cc3.tar.gz
troggle-c44dea4d2b245c1bc330120319417f438ec12cc3.tar.bz2
troggle-c44dea4d2b245c1bc330120319417f438ec12cc3.zip
More comment, to-do
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]