Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,14 +37,13 @@ def add_attendance(names):
|
|
| 37 |
url = "https://20march2024-flask.glitch.me/adduserdata1" # Change this URL to your Glitch endpoint
|
| 38 |
success_count = 0
|
| 39 |
print(len(names))
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
st.warning(f"Failed to mark attendance for {name}")
|
| 48 |
|
| 49 |
if success_count == len(names):
|
| 50 |
st.success("Attendance marked for all recognized faces. Have a good day!")
|
|
|
|
| 37 |
url = "https://20march2024-flask.glitch.me/adduserdata1" # Change this URL to your Glitch endpoint
|
| 38 |
success_count = 0
|
| 39 |
print(len(names))
|
| 40 |
+
|
| 41 |
+
data = {'name': name}
|
| 42 |
+
response = requests.post(url, data=data)
|
| 43 |
+
if response.status_code == 200:
|
| 44 |
+
success_count += 1
|
| 45 |
+
else:
|
| 46 |
+
st.warning(f"Failed to mark attendance for {name}")
|
|
|
|
| 47 |
|
| 48 |
if success_count == len(names):
|
| 49 |
st.success("Attendance marked for all recognized faces. Have a good day!")
|