fix snapshot uuid

This commit is contained in:
Nick Sweeting 2024-08-18 01:07:21 -07:00
parent 8c50257fe9
commit 57d31b2b14
No known key found for this signature in database
4 changed files with 12 additions and 6 deletions

View file

@ -294,7 +294,10 @@ class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
)
def identifiers(self, obj):
return get_abid_info(self, obj)
try:
return get_abid_info(self, obj)
except Exception as e:
return str(e)
@admin.display(
description='Title',

View file

@ -140,6 +140,9 @@ class Snapshot(ABIDModel):
keys = ('url', 'timestamp', 'title', 'tags', 'updated')
@property
def uuid(self):
return self.id
def __repr__(self) -> str:
title = self.title or '-'
@ -354,7 +357,7 @@ class ArchiveResult(ABIDModel):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True, unique=True, verbose_name='ID')
abid = ABIDField(prefix=abid_prefix)
snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE, to_field='id')
snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE, to_field='id', db_column='snapshot_id')
extractor = models.CharField(choices=EXTRACTOR_CHOICES, max_length=32)
cmd = models.JSONField()