jarajpu commited on
Commit
659f15b
·
1 Parent(s): 8204020

Removing 20% bid points cap

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -164,9 +164,9 @@ def submit_prediction(
164
  st.error("Prediction submission time has passed. Predictions can't be submitted after match start.")
165
  return
166
 
167
- if bid_points > max_bid_points:
168
- st.error(f"Your bid points exceed the 20% limit of your total points. Maximum allowed bid points: {max_bid_points}")
169
- return
170
 
171
  prediction_id = uuid.uuid4().hex
172
  prediction_time = datetime.now().strftime('%Y-%m-%d')
@@ -221,11 +221,10 @@ def get_user_total_points(user_name):
221
  return users.get(user_name, {}).get("0", 0)
222
 
223
 
224
- # Define the new function
225
- def calculate_max_bid_points(user_name):
226
- total_points = get_user_total_points(user_name)
227
- max_bid_points = int(total_points * 0.20) # 20% of total points
228
- return max_bid_points
229
 
230
 
231
  def load_users(USERS_JSON):
@@ -241,9 +240,9 @@ def user_selection_and_prediction():
241
  user_name = st.selectbox("Select User", ["Select a user..."] + users)
242
 
243
  max_bid_points = None
244
- if user_name != "Select a user...":
245
- max_bid_points = calculate_max_bid_points(user_name)
246
- st.write(f"Maximum bid points you can submit: {max_bid_points}")
247
 
248
  matches = get_today_matches()
249
  if matches:
 
164
  st.error("Prediction submission time has passed. Predictions can't be submitted after match start.")
165
  return
166
 
167
+ # if bid_points > max_bid_points:
168
+ # st.error(f"Your bid points exceed the 20% limit of your total points. Maximum allowed bid points: {max_bid_points}")
169
+ # return
170
 
171
  prediction_id = uuid.uuid4().hex
172
  prediction_time = datetime.now().strftime('%Y-%m-%d')
 
221
  return users.get(user_name, {}).get("0", 0)
222
 
223
 
224
+ # def calculate_max_bid_points(user_name):
225
+ # total_points = get_user_total_points(user_name)
226
+ # max_bid_points = int(total_points * 0.20) # 20% of total points
227
+ # return max_bid_points
 
228
 
229
 
230
  def load_users(USERS_JSON):
 
240
  user_name = st.selectbox("Select User", ["Select a user..."] + users)
241
 
242
  max_bid_points = None
243
+ # if user_name != "Select a user...":
244
+ # max_bid_points = calculate_max_bid_points(user_name)
245
+ # st.write(f"Maximum bid points you can submit: {max_bid_points}")
246
 
247
  matches = get_today_matches()
248
  if matches: