Update app.py
Browse files
app.py
CHANGED
@@ -165,6 +165,16 @@ def filter_by_fields(selected_country, selected_city, selected_language):
|
|
165 |
html += "</table>"
|
166 |
return html
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
# Gradio Interface
|
170 |
with gr.Blocks(css=".gr-dropdown { max-height: 100px; overflow-y: auto; font-size: 12px; }") as demo:
|
|
|
165 |
html += "</table>"
|
166 |
return html
|
167 |
|
168 |
+
def delete_by_discord(discord, code):
|
169 |
+
if code != ADMIN_CODE:
|
170 |
+
return "❌ Invalid admin code."
|
171 |
+
with open(DATA_FILE, "r") as f:
|
172 |
+
data = json.load(f)
|
173 |
+
new_data = [d for d in data if d["Discord"].lower() != discord.lower()]
|
174 |
+
with open(DATA_FILE, "w") as f:
|
175 |
+
json.dump(new_data, f, indent=2)
|
176 |
+
return f"🗑️ Deleted user with Discord: {discord}"
|
177 |
+
|
178 |
|
179 |
# Gradio Interface
|
180 |
with gr.Blocks(css=".gr-dropdown { max-height: 100px; overflow-y: auto; font-size: 12px; }") as demo:
|