DmitrMakeev commited on
Commit
e4f605f
1 Parent(s): 10cd054

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -224,6 +224,7 @@ def show_data_gc():
224
 
225
 
226
 
 
227
  @app.route('/data_gc_tab', methods=['GET'])
228
  def data_gc_tab():
229
  try:
@@ -244,6 +245,18 @@ def data_gc_tab():
244
  print(f"Error getting data from data_gc: {e}")
245
  return "Internal Server Error", 500
246
 
 
 
 
 
 
 
 
 
 
 
 
 
247
 
248
 
249
 
 
224
 
225
 
226
 
227
+
228
  @app.route('/data_gc_tab', methods=['GET'])
229
  def data_gc_tab():
230
  try:
 
245
  print(f"Error getting data from data_gc: {e}")
246
  return "Internal Server Error", 500
247
 
248
+ def get_total_users():
249
+ try:
250
+ conn = sqlite3.connect('data_gc.db')
251
+ cursor = conn.cursor()
252
+ cursor.execute('SELECT COUNT(*) FROM contacts')
253
+ total_users = cursor.fetchone()[0]
254
+ conn.close()
255
+ return total_users
256
+ except Exception as e:
257
+ print(f"Error getting total users: {e}")
258
+ return 0
259
+
260
 
261
 
262