mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 05:55:06 +00:00
Deep fix, nonunique ids in logbookentries fixed
This commit is contained in:
@@ -59,16 +59,16 @@ def expedition(request, expeditionname):
|
||||
if request.user.is_authenticated:
|
||||
if "reload" in request.GET:
|
||||
this_expedition = Expedition.objects.get(year=int(expeditionname))
|
||||
# Need to delete the exisitng entries or we get duplication
|
||||
# Need to delete the existing entries or we get duplication
|
||||
# Need to delete both in the Django ORM and in our own object-store.
|
||||
entries = this_expedition.logbookentry_set.all()
|
||||
print(f'! - expo {expeditionname} {len(entries)} entries')
|
||||
print(f'! - expo {expeditionname} {len(entries)} entries initially')
|
||||
for entry in entries:
|
||||
print(f'! - delete entry: "{entry}"')
|
||||
#print(f'! - delete entry: "{entry}"')
|
||||
entry.delete()
|
||||
entries = this_expedition.logbookentry_set.all()
|
||||
print(f'! - expo {expeditionname} {len(entries)} entries')
|
||||
LoadLogbookForExpedition(this_expedition, 0) # 0 means re-parse
|
||||
print(f'! - expo {expeditionname} {len(entries)} entries after deletion')
|
||||
LoadLogbookForExpedition(this_expedition, 0) # 0 means re-parse as implies cache expected to be 0
|
||||
logged_in = True
|
||||
else:
|
||||
logged_in = False
|
||||
|
||||
Reference in New Issue
Block a user