DmitrMakeev commited on
Commit
da799e4
1 Parent(s): 2021172

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -722,7 +722,19 @@ gog_url = "https://docs.google.com/forms/d/e/1FAIpQLSc-JbmXvgpgGq6KrkXsYSsfMACVM
722
 
723
 
724
  DATABASE_NAME = 'data_gc.db'
 
 
 
 
 
 
 
 
 
 
 
725
 
 
726
  def update_or_insert_user(db_name, user_data, mapping_template, gog_url):
727
  conn = sqlite3.connect(db_name)
728
  cursor = conn.cursor()
 
722
 
723
 
724
  DATABASE_NAME = 'data_gc.db'
725
+ def send_to_google_forms(user_data, gog_url):
726
+ # Формирование URL с параметрами
727
+ url = gog_url.format(**user_data)
728
+
729
+ # Отправка POST-запроса
730
+ response = requests.post(url)
731
+
732
+ if response.status_code == 200:
733
+ logging.debug(f"Data sent to Google Forms successfully for user: {user_data.get('email')}")
734
+ else:
735
+ logging.error(f"Failed to send data to Google Forms for user: {user_data.get('email')}. Response: {response.text}")
736
 
737
+
738
  def update_or_insert_user(db_name, user_data, mapping_template, gog_url):
739
  conn = sqlite3.connect(db_name)
740
  cursor = conn.cursor()