Skip to content

Commit

Permalink
fix(paas/saas): saas version list sort by upload time (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
wklken authored Jan 12, 2023
1 parent 9d00815 commit 522e94d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.41
2.14.42
9 changes: 6 additions & 3 deletions paas2/paas/saas/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_queryset(self):


class SaaSVersionManager(models.Manager):
def get_version_list(self, saas_app, limit=10):
def get_version_list(self, saas_app, limit=20):
if not saas_app:
return []

Expand All @@ -76,8 +76,11 @@ def get_version_list(self, saas_app, limit=10):
try:
saas_versions = sorted(saas_versions, key=lambda s: list(map(int, s.version.split("."))), reverse=True)
except Exception:
logger.exception("there got one wrong version in the saas list")
saas_versions = sorted(saas_versions, key=lambda s: s.version, reverse=True)
# logger.exception("there got one wrong version in the saas list")
try:
saas_versions = sorted(saas_versions, key=lambda s: s.upload_file.uploaded_at, reverse=True)
except Exception:
saas_versions = sorted(saas_versions, key=lambda s: s.version, reverse=True)

# then limit
saas_versions = saas_versions[:limit]
Expand Down
3 changes: 3 additions & 0 deletions paas2/release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Release Log
===============================
# 2.14.42
- update: saas version list sort by upload time

# 2.14.41
- update: esb update data, monitor_v3, iam confapis

Expand Down

0 comments on commit 522e94d

Please sign in to comment.