working archivebox update CLI cmd

This commit is contained in:
Nick Sweeting 2024-11-19 02:31:59 -08:00
parent a0edf218e8
commit c9a05c9d94
No known key found for this signature in database
7 changed files with 61 additions and 114 deletions

View file

@ -192,7 +192,7 @@ class Snapshot(ModelWithOutputDir, ModelWithStateMachine, ABIDModel):
objects = SnapshotManager()
def save(self, *args, **kwargs):
print(f'{self}.save()')
print(f'Snapshot[{self.ABID}].save()')
if self.pk:
existing_snapshot = self.__class__.objects.filter(pk=self.pk).first()
if existing_snapshot and existing_snapshot.status == self.StatusChoices.SEALED:
@ -634,7 +634,7 @@ class ArchiveResult(ModelWithOutputDir, ModelWithStateMachine, ABIDModel):
return repr(self)
def save(self, *args, write_indexes: bool=False, **kwargs):
print(f'{self}.save()')
print(f'ArchiveResult[{self.ABID}].save()')
# if (self.pk and self.__class__.objects.filter(pk=self.pk).values_list('status', flat=True)[0] in [self.StatusChoices.FAILED, self.StatusChoices.SUCCEEDED, self.StatusChoices.SKIPPED]):
# raise Exception(f'ArchiveResult {self.pk} is in a final state, it cannot be modified any further.')
if self.pk: