diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index 4e1e3af1..67f87fd0 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -36,7 +36,7 @@ from sqlalchemy import or_ @menu.register_menu(bp, ".mods", "Mods", order=11, endpoint_arguments_constructor=lambda: { 'type': 'mod' }) @menu.register_menu(bp, ".games", "Games", order=12, endpoint_arguments_constructor=lambda: { 'type': 'game' }) @menu.register_menu(bp, ".txp", "Texture Packs", order=13, endpoint_arguments_constructor=lambda: { 'type': 'txp' }) -@menu.register_menu(bp, ".random", "Random", order=14, endpoint_arguments_constructor=lambda: { 'random': '1' }) +@menu.register_menu(bp, ".random", "Random", order=14, endpoint_arguments_constructor=lambda: { 'random': '1', 'lucky': '1' }) @bp.route("/packages/") def list_all(): qb = QueryBuilder(request.args) diff --git a/app/querybuilder.py b/app/querybuilder.py index b9a31ef6..d6b55045 100644 --- a/app/querybuilder.py +++ b/app/querybuilder.py @@ -25,7 +25,7 @@ class QueryBuilder: self.types = types self.search = args.get("q") self.random = "random" in args - self.lucky = self.random or "lucky" in args + self.lucky = "lucky" in args self.hide_nonfree = "nonfree" in hide_flags self.limit = 1 if self.lucky else None self.order_by = args.get("sort")