1
0
Fork 0
mirror of synced 2024-06-26 10:00:19 +12:00

only get archive_size if index.html is present within dir

This commit is contained in:
Nick Sweeting 2021-02-16 15:51:17 -05:00
parent c24e4bf11d
commit a6c64f2560

View file

@ -157,7 +157,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
return snapshot_icons(obj)
def size(self, obj):
archive_size = obj.archive_size
archive_size = (Path(obj.link_dir) / 'index.html').exists() and obj.archive_size
if archive_size:
size_txt = printable_filesize(archive_size)
if archive_size > 52428800: