Update app.py
Browse files
app.py
CHANGED
|
@@ -791,8 +791,8 @@ def update_or_insert_user(db_name, user_data, mapping_template, gog_url):
|
|
| 791 |
transformed_data['phone'] = phone
|
| 792 |
logging.debug(f"Transformed data after phone processing: {transformed_data}")
|
| 793 |
|
| 794 |
-
# Update or set the `ws_st` value
|
| 795 |
-
transformed_data['ws_st'] =
|
| 796 |
|
| 797 |
# Increment `web_st` value
|
| 798 |
if current_values.get('web_st'):
|
|
@@ -813,7 +813,7 @@ def update_or_insert_user(db_name, user_data, mapping_template, gog_url):
|
|
| 813 |
update_values = []
|
| 814 |
columns_to_update = []
|
| 815 |
for column, value in transformed_data.items():
|
| 816 |
-
if column
|
| 817 |
update_query += f"{column} = ?, "
|
| 818 |
update_values.append(value)
|
| 819 |
columns_to_update.append(column)
|
|
|
|
| 791 |
transformed_data['phone'] = phone
|
| 792 |
logging.debug(f"Transformed data after phone processing: {transformed_data}")
|
| 793 |
|
| 794 |
+
# Update or set the `ws_st` value, but do not update it if it exists
|
| 795 |
+
transformed_data['ws_st'] = current_values.get('ws_st', "")
|
| 796 |
|
| 797 |
# Increment `web_st` value
|
| 798 |
if current_values.get('web_st'):
|
|
|
|
| 813 |
update_values = []
|
| 814 |
columns_to_update = []
|
| 815 |
for column, value in transformed_data.items():
|
| 816 |
+
if column not in ['curator', 'ws_st'] and value != current_values.get(column, ""): # Exclude `curator` and `ws_st`, and only update if value has changed
|
| 817 |
update_query += f"{column} = ?, "
|
| 818 |
update_values.append(value)
|
| 819 |
columns_to_update.append(column)
|