Skip to content

Commit

Permalink
show packages without active versions (leftover of #106)
Browse files Browse the repository at this point in the history
- do not hide package in packages when there is no active version (SynoCommunity/spksrc#5803)
- remove obsolete TODOs
  • Loading branch information
hgy59 committed Jan 1, 2024
1 parent f7ed0fd commit 19ae314
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spkrepo/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def on_model_delete(self, model):
("upgrade_wizard", "upgrade_wizard"),
("startable", "startable"),
)
# TODO: Add beta and all_builds_active with Flask-Admin>1.0.8

column_default_sort = (Version.insert_date, True)

# Custom queries
Expand Down Expand Up @@ -533,7 +533,7 @@ def can_unsign(self):
("insert_date", "insert_date"),
("active", "active"),
)
# TODO: Add version.package with Flask-Admin>1.0.8

column_default_sort = (Build.insert_date, True)

# Custom queries
Expand Down
3 changes: 1 addition & 2 deletions spkrepo/views/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ def profile():

@frontend.route("/packages")
def packages():
# show only packages with at least one version, but ignore whether builds are active
latest_version = (
db.session.query(
Version.package_id, db.func.max(Version.version).label("latest_version")
)
.join(Build)
.filter(Build.active)
.group_by(Version.package_id)
.subquery()
)
Expand All @@ -96,7 +96,6 @@ def packages():

@frontend.route("/package/<name>")
def package(name):
# TODO: show only packages with at least a version and an active build
package = Package.query.filter_by(name=name).first()
if package is None:
abort(404)
Expand Down

0 comments on commit 19ae314

Please sign in to comment.