1
0
forked from erp-dev/erp

fix: appversions

This commit is contained in:
2026-07-11 00:05:05 +08:00
parent 48e4782e1e
commit e91d06e4b6
26 changed files with 2582 additions and 19 deletions

View File

@@ -70,11 +70,12 @@ class AppVersion(ModelBase):
return f'{self.major}.{self.minor}.{self.build}'
def save(self, *args, **kwargs):
if self.package_file:
self.download_url = self.package_file.url
if self.is_current:
AppVersion.objects.exclude(pk=self.pk).filter(is_current=True).update(is_current=False)
super().save(*args, **kwargs)
if self.package_file and not self.download_url:
self.download_url = self.package_file.url
AppVersion.objects.filter(pk=self.pk).update(download_url=self.download_url)
class UploadedFile(ModelBase):