Use filename when downloading asset through UI (#1146)

This commit is contained in:
Per Mortensen
2025-08-10 08:38:18 +02:00
committed by GitHub
parent 5330252db9
commit 93faf70b37
4 changed files with 53 additions and 11 deletions

View File

@@ -133,6 +133,14 @@ class BookmarkAsset(models.Model):
status = models.CharField(max_length=64, blank=False, null=False)
gzip = models.BooleanField(default=False, null=False)
@property
def download_name(self):
return (
f"{self.display_name}.html"
if self.asset_type == BookmarkAsset.TYPE_SNAPSHOT
else self.display_name
)
def save(self, *args, **kwargs):
if self.file:
try: