diff --git a/__pycache__/db.cpython-38.pyc b/__pycache__/db.cpython-38.pyc index 0aa9d2d..429d176 100644 Binary files a/__pycache__/db.cpython-38.pyc and b/__pycache__/db.cpython-38.pyc differ diff --git a/db.py b/db.py index e3f06ad..6a22102 100644 --- a/db.py +++ b/db.py @@ -778,6 +778,9 @@ def max_price(): max_price = cur.fetchall() + if max_price[0][0] is None: + return 10 + return max_price[0][0] diff --git a/pages/Leaderboard.py b/pages/Leaderboard.py index 5bf1902..77258d6 100644 --- a/pages/Leaderboard.py +++ b/pages/Leaderboard.py @@ -12,7 +12,12 @@ ids = db.distinct_business_ids() -number_names = st.slider("Number of Businesses", min_value=1, max_value=len(ids)) +num_ids = len(ids) + +if num_ids < 2: + num_ids = 2 + +number_names = st.slider("Number of Businesses", min_value=1, max_value=num_ids) businesses = db.displayLeaderboard(number_names) diff --git a/pages/Listings.py b/pages/Listings.py index ce04832..cba4602 100644 --- a/pages/Listings.py +++ b/pages/Listings.py @@ -151,7 +151,7 @@ def filter_interface(): max_item_price = math.ceil(db.max_price()) - price = st.slider("Listings price", value = (0, max_item_price), step = 1) + price = st.slider("Listings price ($)", value = (0, max_item_price), step = 1) filter_dict["price"] = price