DmitrMakeev commited on
Commit
e4c74f9
1 Parent(s): ad426ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -32
app.py CHANGED
@@ -151,36 +151,7 @@ def start_mailings():
151
 
152
 
153
 
154
- @app.route('/data_gc_tab_out', methods=['GET'])
155
- def data_gc_tab_out():
156
- try:
157
- api_sys_control = request.args.get('api_sys')
158
-
159
- if api_sys_control != api_key_sys:
160
- return "EUR 22", 200
161
-
162
- conn = sqlite3.connect('data_gc.db')
163
- cursor = conn.cursor()
164
- cursor.execute('''
165
- SELECT id, name, phone, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
166
- shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url, curator
167
- FROM contacts
168
- ''')
169
- contacts = cursor.fetchall()
170
- conn.close()
171
 
172
- contacts_json = [{
173
- 'id': contact[0], 'name': contact[1], 'phone': contact[2], 'email': contact[3],
174
- 'vk_id': contact[4], 'chat_id': contact[5], 'ws_statys': contact[6], 'ws_stop': contact[7],
175
- 'web_statys': contact[8], 'fin_progress': contact[9], 'shop_statys_full': contact[10],
176
- 'pr1': contact[11], 'pr2': contact[12], 'pr3': contact[13], 'pr4': contact[14],
177
- 'pr5': contact[15], 'ad_url': contact[16], 'curator': contact[17]
178
- } for contact in contacts]
179
- return jsonify(contacts_json), 200
180
- except Exception as e:
181
- error_message = f"Error getting data from data_gc: {e}"
182
- print(error_message)
183
- return error_message, 500
184
 
185
 
186
 
@@ -323,9 +294,9 @@ def data_gc_tab_out():
323
  } for contact in contacts]
324
  return jsonify(contacts_json), 200
325
  except Exception as e:
326
- print(f"Error getting data from data_gc: {e}")
327
- return "Internal Server Error", 500
328
-
329
 
330
 
331
 
 
151
 
152
 
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
 
157
 
 
294
  } for contact in contacts]
295
  return jsonify(contacts_json), 200
296
  except Exception as e:
297
+ error_message = f"Error getting data from data_gc: {e}"
298
+ print(error_message)
299
+ return error_message, 500
300
 
301
 
302