remove .old_id entirely and make ABID generation only happen once on initial save

This commit is contained in:
Nick Sweeting
2024-09-04 16:40:15 -07:00
parent 22a6666bab
commit 68a39b7392
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)