sehaj13 commited on
Commit
4636220
·
verified ·
1 Parent(s): 247d3c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -112,14 +112,15 @@ with app_tab:
112
 
113
  # --- Send data to external API ---
114
  url = "https://skattendancesystem25.glitch.me/adds"
115
- data = {'rno': '15', 'sname': pname, 'sclass': '7'}
116
- response = requests.post(url, data=data)
 
117
  if response.status_code == 200:
118
  st.success("Attendance marked successfully.")
119
  else:
120
  st.warning("Failed to update attendance.")
121
- # except Exception as e:
122
- # st.error(f"Request failed: {e}")
123
  else:
124
  st.error("❌ Match not found. Try again.")
125
  # try:
 
112
 
113
  # --- Send data to external API ---
114
  url = "https://skattendancesystem25.glitch.me/adds"
115
+ data = {'rno': 15, 'sname': matched_name, 'sclass': 7}
116
+ try:
117
+ response = requests.post(url, data=data)
118
  if response.status_code == 200:
119
  st.success("Attendance marked successfully.")
120
  else:
121
  st.warning("Failed to update attendance.")
122
+ except Exception as e:
123
+ st.error(f"Request failed: {e}")
124
  else:
125
  st.error("❌ Match not found. Try again.")
126
  # try: