DmitrMakeev commited on
Commit
02ab734
1 Parent(s): f017436

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -108,8 +108,8 @@ template = {
108
  "finished": "b_fin",
109
  "ban": "b_ban",
110
  "ignore": "b_ign",
111
- "banners": "b_baners", # Если массив заполнен пишем -1, если пустой пишем - 0
112
- "buttons": "b_butt", # Если массив заполнен пишем -1, если пустой пишем - 0
113
  "messages": "b_mess"
114
  }
115
 
@@ -785,7 +785,7 @@ def update_or_insert_user(db_name, user_data, mapping_template):
785
  for json_key, db_column in mapping_template.items():
786
  value = user_data.get(json_key, "")
787
  if isinstance(value, list):
788
- transformed_data[db_column] = "-1" if value else "0"
789
  else:
790
  transformed_data[db_column] = str(value)
791
 
 
108
  "finished": "b_fin",
109
  "ban": "b_ban",
110
  "ignore": "b_ign",
111
+ "banners": "b_baners",
112
+ "buttons": "b_butt",
113
  "messages": "b_mess"
114
  }
115
 
 
785
  for json_key, db_column in mapping_template.items():
786
  value = user_data.get(json_key, "")
787
  if isinstance(value, list):
788
+ transformed_data[db_column] = "1" if value else "0"
789
  else:
790
  transformed_data[db_column] = str(value)
791