nagasurendra commited on
Commit
4121555
·
verified ·
1 Parent(s): 4180b73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -179,13 +179,25 @@ def reward_status():
179
  user_points = round(user_points)
180
  points_needed_for_next_tier = round(points_needed_for_next_tier)
181
 
 
 
 
 
 
 
 
 
 
182
  return render_template(
183
  'reward_status.html',
184
  user_points=user_points,
185
  current_tier=current_tier,
186
  points_needed_for_next_tier=points_needed_for_next_tier,
187
- progress_percentage=progress_percentage
 
 
188
  )
 
189
  @app.route("/logout")
190
  def logout():
191
  # Retrieve table number before clearing session
 
179
  user_points = round(user_points)
180
  points_needed_for_next_tier = round(points_needed_for_next_tier)
181
 
182
+ # Calculate the next tier dynamically
183
+ next_tier = None
184
+ tier_names = ["Bronze", "Silver", "Gold", "Platinum"]
185
+ current_tier_index = tier_names.index(current_tier)
186
+
187
+ # Set next tier if not already in Platinum
188
+ if current_tier != "Platinum":
189
+ next_tier = tier_names[current_tier_index + 1]
190
+
191
  return render_template(
192
  'reward_status.html',
193
  user_points=user_points,
194
  current_tier=current_tier,
195
  points_needed_for_next_tier=points_needed_for_next_tier,
196
+ progress_percentage=progress_percentage,
197
+ next_tier=next_tier,
198
+ tiers=tiers # Passing tiers for dynamic bar range
199
  )
200
+
201
  @app.route("/logout")
202
  def logout():
203
  # Retrieve table number before clearing session