Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,7 +83,7 @@ def submit_profile(name, discord, city, country, address, looking, onlinecheck,
|
|
| 83 |
|
| 84 |
lang_str = ", ".join(languages) if isinstance(languages, list) else languages
|
| 85 |
|
| 86 |
-
conn = sqlite3.connect(
|
| 87 |
c = conn.cursor()
|
| 88 |
c.execute("""
|
| 89 |
INSERT INTO teamup (discord, name, city, country, address, looking, onlinecheck, languages, laptop, robot, skills, describe3, experience, idea)
|
|
@@ -109,7 +109,7 @@ def submit_profile(name, discord, city, country, address, looking, onlinecheck,
|
|
| 109 |
|
| 110 |
# Filter and return HTML table
|
| 111 |
def filter_by_fields(selected_country, selected_city, selected_language):
|
| 112 |
-
conn = sqlite3.connect(
|
| 113 |
df = pd.read_sql_query("SELECT * FROM teamup", conn)
|
| 114 |
conn.close()
|
| 115 |
|
|
@@ -150,7 +150,7 @@ def filter_by_fields(selected_country, selected_city, selected_language):
|
|
| 150 |
|
| 151 |
# Update city dropdown
|
| 152 |
def update_city_filter(country):
|
| 153 |
-
conn = sqlite3.connect(
|
| 154 |
c = conn.cursor()
|
| 155 |
if country == "All":
|
| 156 |
c.execute("SELECT DISTINCT city FROM teamup")
|
|
@@ -164,7 +164,7 @@ def update_city_filter(country):
|
|
| 164 |
def delete_by_discord(discord, code):
|
| 165 |
if code != ADMIN_CODE:
|
| 166 |
return "❌ Invalid admin code."
|
| 167 |
-
conn = sqlite3.connect(
|
| 168 |
c = conn.cursor()
|
| 169 |
c.execute("DELETE FROM teamup WHERE lower(discord) = ?", (discord.lower(),))
|
| 170 |
conn.commit()
|
|
|
|
| 83 |
|
| 84 |
lang_str = ", ".join(languages) if isinstance(languages, list) else languages
|
| 85 |
|
| 86 |
+
conn = sqlite3.connect(DB_PATH)
|
| 87 |
c = conn.cursor()
|
| 88 |
c.execute("""
|
| 89 |
INSERT INTO teamup (discord, name, city, country, address, looking, onlinecheck, languages, laptop, robot, skills, describe3, experience, idea)
|
|
|
|
| 109 |
|
| 110 |
# Filter and return HTML table
|
| 111 |
def filter_by_fields(selected_country, selected_city, selected_language):
|
| 112 |
+
conn = sqlite3.connect(DB_PATH)
|
| 113 |
df = pd.read_sql_query("SELECT * FROM teamup", conn)
|
| 114 |
conn.close()
|
| 115 |
|
|
|
|
| 150 |
|
| 151 |
# Update city dropdown
|
| 152 |
def update_city_filter(country):
|
| 153 |
+
conn = sqlite3.connect(DB_PATH)
|
| 154 |
c = conn.cursor()
|
| 155 |
if country == "All":
|
| 156 |
c.execute("SELECT DISTINCT city FROM teamup")
|
|
|
|
| 164 |
def delete_by_discord(discord, code):
|
| 165 |
if code != ADMIN_CODE:
|
| 166 |
return "❌ Invalid admin code."
|
| 167 |
+
conn = sqlite3.connect(DB_PATH)
|
| 168 |
c = conn.cursor()
|
| 169 |
c.execute("DELETE FROM teamup WHERE lower(discord) = ?", (discord.lower(),))
|
| 170 |
conn.commit()
|