remove .old_id entirely and make ABID generation only happen once on initial save
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run

This commit is contained in:
Nick Sweeting 2024-09-04 16:40:15 -07:00
parent 22a6666bab
commit 68a39b7392
No known key found for this signature in database
11 changed files with 242 additions and 142 deletions

View file

@ -192,7 +192,6 @@ class Link:
if extended:
info.update({
'snapshot_id': self.snapshot_id,
'snapshot_old_id': self.snapshot_old_id,
'snapshot_abid': self.snapshot_abid,
'link_dir': self.link_dir,
@ -266,16 +265,12 @@ class Link:
@cached_property
def snapshot(self):
from core.models import Snapshot
return Snapshot.objects.only('id', 'old_id', 'abid').get(url=self.url)
return Snapshot.objects.only('id', 'abid').get(url=self.url)
@cached_property
def snapshot_id(self):
return str(self.snapshot.pk)
@cached_property
def snapshot_old_id(self):
return str(self.snapshot.old_id)
@cached_property
def snapshot_abid(self):
return str(self.snapshot.ABID)