Use a materialized Extension.latest_version field instead of a dynamic property #152
@ -409,7 +409,7 @@ class Extension(CreatedModifiedMixin, RatingMixin, TrackChangesMixin, models.Mod
|
|||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def update_latest_version(self, skip_version=None):
|
def update_latest_version(self, skip_version=None):
|
||||||
versions = self.versions.select_related('file').all().order_by('-date_created')
|
versions = self.versions.select_related('file').order_by('-date_created')
|
||||||
latest_version = None
|
latest_version = None
|
||||||
for version in versions:
|
for version in versions:
|
||||||
if skip_version and version == skip_version:
|
if skip_version and version == skip_version:
|
||||||
|
Loading…
Reference in New Issue
Block a user