update REST API and Admin UI to use new id and old_id exclusively
Some checks failed
Build Homebrew package / build (push) Has been cancelled
Run linters / lint (push) Has been cancelled
Build Debian package / build (push) Has been cancelled
Build Docker image / buildx (push) Has been cancelled
Build Pip package / build (push) Has been cancelled
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Has been cancelled
Run tests / docker_tests (push) Has been cancelled

This commit is contained in:
Nick Sweeting 2024-08-19 20:00:04 -07:00
parent 344e902fc6
commit c4ef2993b2
No known key found for this signature in database
3 changed files with 26 additions and 25 deletions

View file

@ -163,6 +163,10 @@ class Snapshot(ABIDModel):
title = self.title or '-'
return f'[{self.timestamp}] {self.url[:64]} ({title[:64]})'
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
assert str(self.id) == str(self.abid.uuid) == str(self.uuid)
@classmethod
def from_json(cls, info: dict):
info = {k: v for k, v in info.items() if k in cls.keys}
@ -391,7 +395,7 @@ class ArchiveResult(ABIDModel):
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
assert str(self.id) == str(self.abid.uuid)
assert str(self.id) == str(self.abid.uuid) == str(self.uuid)
@property
def uuid(self):