Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,14 +113,17 @@ with app_tab:
|
|
| 113 |
# --- Send data to external API ---
|
| 114 |
url = "https://sehajpreet-aiml-2025.glitch.me/addg"
|
| 115 |
data = {'rno': '15', 'sname': pname, 'sclass': '7'}
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
| 122 |
else:
|
| 123 |
-
st.
|
| 124 |
# try:
|
| 125 |
|
| 126 |
# response = requests.post(url, data=data)
|
|
|
|
| 113 |
# --- Send data to external API ---
|
| 114 |
url = "https://sehajpreet-aiml-2025.glitch.me/addg"
|
| 115 |
data = {'rno': '15', 'sname': pname, 'sclass': '7'}
|
| 116 |
+
|
| 117 |
+
try:
|
| 118 |
+
response = requests.post(url, data=data)
|
| 119 |
+
if response.status_code == 200:
|
| 120 |
+
st.success("Attendance marked successfully.")
|
| 121 |
+
else:
|
| 122 |
+
st.warning("Failed to update attendance.")
|
| 123 |
+
except Exception as e:
|
| 124 |
+
st.error(f"Request failed: {e}")
|
| 125 |
else:
|
| 126 |
+
st.error("❌ Match not found. Try again.")
|
| 127 |
# try:
|
| 128 |
|
| 129 |
# response = requests.post(url, data=data)
|