Spaces:
Sleeping
Sleeping
ChenyuRabbitLove
commited on
Commit
·
31d21e7
1
Parent(s):
263813c
feat: rename ntu img to ruby
Browse files- utils/completion_reward_utils.py +11 -38
utils/completion_reward_utils.py
CHANGED
@@ -30,55 +30,28 @@ def check_is_in_completion_reward(player_backend_user_id):
|
|
30 |
with open("./data/completion_reward_issue_status.json") as f:
|
31 |
completion_reward_issue_status_dict = json.load(f)
|
32 |
completion_reward_issue_status_dict["[email protected]"] = "not_issued"
|
33 |
-
completion_reward_issue_status_dict[
|
34 |
-
"http://googleid.junyiacademy.org/115084976189396533674"
|
35 |
-
] = "not_issued"
|
36 |
-
completion_reward_issue_status_dict[
|
37 |
-
"http://googleid.junyiacademy.org/106428943548495187296"
|
38 |
-
] = "not_issued"
|
39 |
-
|
40 |
-
preview_list = [
|
41 |
-
"[email protected]",
|
42 |
-
"[email protected]",
|
43 |
-
"http://googleid.junyiacademy.org/111939868185365078143",
|
44 |
-
"http://googleid.junyiacademy.org/107407156051367422051",
|
45 |
-
"http://googleid.junyiacademy.org/115084976189396533674",
|
46 |
-
"http://googleid.junyiacademy.org/106428943548495187296",
|
47 |
-
"http://id.junyiacademy.org/28f0f5bb784441c58ad4bafad00a2c3d",
|
48 |
-
]
|
49 |
|
50 |
if (
|
51 |
player_backend_user_id in completion_reward_issue_status_dict
|
52 |
-
or player_backend_user_id in preview_list
|
53 |
):
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
)
|
65 |
-
else:
|
66 |
-
return (
|
67 |
-
gr.update(visible=False),
|
68 |
-
gr.update(visible=False),
|
69 |
-
gr.update(visible=False),
|
70 |
-
gr.update(visible=False),
|
71 |
-
gr.update(visible=False),
|
72 |
-
gr.Image(value, visible=True, elem_id="certificate"),
|
73 |
-
)
|
74 |
else:
|
75 |
return (
|
76 |
gr.update(visible=False),
|
77 |
gr.update(visible=False),
|
78 |
gr.update(visible=False),
|
79 |
gr.update(visible=False),
|
80 |
-
gr.update(visible=True),
|
81 |
gr.update(visible=False),
|
|
|
82 |
)
|
83 |
|
84 |
else:
|
|
|
30 |
with open("./data/completion_reward_issue_status.json") as f:
|
31 |
completion_reward_issue_status_dict = json.load(f)
|
32 |
completion_reward_issue_status_dict["[email protected]"] = "not_issued"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
if (
|
35 |
player_backend_user_id in completion_reward_issue_status_dict
|
|
|
36 |
):
|
37 |
+
value = completion_reward_issue_status_dict[player_backend_user_id]
|
38 |
+
if value == "not_issued":
|
39 |
+
return (
|
40 |
+
gr.update(visible=True),
|
41 |
+
gr.update(visible=True),
|
42 |
+
gr.update(visible=True),
|
43 |
+
gr.update(visible=False),
|
44 |
+
gr.update(visible=False),
|
45 |
+
gr.update(visible=False),
|
46 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
else:
|
48 |
return (
|
49 |
gr.update(visible=False),
|
50 |
gr.update(visible=False),
|
51 |
gr.update(visible=False),
|
52 |
gr.update(visible=False),
|
|
|
53 |
gr.update(visible=False),
|
54 |
+
gr.Image(value, visible=True, elem_id="certificate"),
|
55 |
)
|
56 |
|
57 |
else:
|