Spaces:
Running
Running
Update miniapp_leaderboard.py
Browse files- miniapp_leaderboard.py +12 -10
miniapp_leaderboard.py
CHANGED
|
@@ -207,16 +207,16 @@ def _check_user_eligibility(username: str) -> tuple[bool, str]:
|
|
| 207 |
|
| 208 |
|
| 209 |
def _submitted_today_anywhere(username: str) -> bool:
|
| 210 |
-
today = datetime.datetime.utcnow().date().isoformat()
|
| 211 |
-
for prefix in (PENDING_PREFIX, APPROVED_PREFIX):
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
return False
|
| 221 |
|
| 222 |
|
|
@@ -328,6 +328,8 @@ def submit(
|
|
| 328 |
sort_dir: str,
|
| 329 |
profile: gr.OAuthProfile | None,
|
| 330 |
):
|
|
|
|
|
|
|
| 331 |
if IN_SPACES and (profile is None or not getattr(profile, "username", None)):
|
| 332 |
return "You must log in to submit.", render_lb(search_text, sort_col, sort_dir)
|
| 333 |
|
|
|
|
| 207 |
|
| 208 |
|
| 209 |
def _submitted_today_anywhere(username: str) -> bool:
|
| 210 |
+
# today = datetime.datetime.utcnow().date().isoformat()
|
| 211 |
+
# for prefix in (PENDING_PREFIX, APPROVED_PREFIX):
|
| 212 |
+
# df = _load_entries_df(prefix, include_filename=False)
|
| 213 |
+
# if df.empty:
|
| 214 |
+
# continue
|
| 215 |
+
# user_rows = df[df["Submitter"].astype(str) == username]
|
| 216 |
+
# if user_rows.empty:
|
| 217 |
+
# continue
|
| 218 |
+
# if any(str(v).startswith(today) for v in user_rows["Submitted at"].tolist()):
|
| 219 |
+
# return True
|
| 220 |
return False
|
| 221 |
|
| 222 |
|
|
|
|
| 328 |
sort_dir: str,
|
| 329 |
profile: gr.OAuthProfile | None,
|
| 330 |
):
|
| 331 |
+
print("SUBMIT: no-daily-limit version")
|
| 332 |
+
|
| 333 |
if IN_SPACES and (profile is None or not getattr(profile, "username", None)):
|
| 334 |
return "You must log in to submit.", render_lb(search_text, sort_col, sort_dir)
|
| 335 |
|