Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
remove member
Browse files
app.py
CHANGED
@@ -871,17 +871,16 @@ def verify_button(profile: gr.OAuthProfile | None, request: gr.Request) -> str:
|
|
871 |
|
872 |
if pd.isnull(hf_user_name) or hf_user_name == 'n/a':
|
873 |
# empty (no link created yet between discord_user_id and hf_user_name) so we can update
|
874 |
-
member = bot.get_member(user_id) # only works if we allow some time after bot restarts
|
875 |
verified_date = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
|
876 |
global_df.loc[global_df['discord_user_id'] == altered_member_id, 'hf_user_name'] = profile.username
|
877 |
global_df.loc[global_df['discord_user_id'] == altered_member_id, 'verified_date'] = verified_date
|
878 |
org_link = "https://huggingface.co/organizations/discord-community/share/wPKRAHYbAlaEaCxUxcqVyaaaeZcYagDvqc"
|
879 |
invite_message = "Click to join our community org on the HF Hub!"
|
880 |
-
return (f"# β
Verification successful! [{
|
881 |
-
print(f"# β
Verification successful! [{
|
882 |
else:
|
883 |
-
return (f"# β The Discord account {
|
884 |
-
print(f"# β The Discord account {
|
885 |
|
886 |
# Remove the token after successful verification
|
887 |
del user_tokens[int(user_id)]
|
|
|
871 |
|
872 |
if pd.isnull(hf_user_name) or hf_user_name == 'n/a':
|
873 |
# empty (no link created yet between discord_user_id and hf_user_name) so we can update
|
|
|
874 |
verified_date = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
|
875 |
global_df.loc[global_df['discord_user_id'] == altered_member_id, 'hf_user_name'] = profile.username
|
876 |
global_df.loc[global_df['discord_user_id'] == altered_member_id, 'verified_date'] = verified_date
|
877 |
org_link = "https://huggingface.co/organizations/discord-community/share/wPKRAHYbAlaEaCxUxcqVyaaaeZcYagDvqc"
|
878 |
invite_message = "Click to join our community org on the HF Hub!"
|
879 |
+
return (f"# β
Verification successful! [Discord ID {user_id} <---> {profile.username}] π€\n{invite_message}\n{org_link} ")
|
880 |
+
print(f"# β
Verification successful! [Discord ID {user_id} <---> {profile.username}] π€")
|
881 |
else:
|
882 |
+
return (f"# β The Discord account {user_id} is already verified! To change discord accounts or HF accounts, contact @lunarflu or adam@huggingface.co")
|
883 |
+
print(f"# β The Discord account {user_id} is already verified! To change discord accounts or HF accounts, contact @lunarflu or adam@huggingface.co")
|
884 |
|
885 |
# Remove the token after successful verification
|
886 |
del user_tokens[int(user_id)]
|