Fix escapes in Ushahidi update_email

This commit is contained in:
Disassembler 2018-08-30 20:11:38 +02:00
parent 9f6ff9f0ee
commit db514b6f4f
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499

View File

@ -105,10 +105,10 @@ def update_email(email):
replace_file_line('/srv/sigmah/conf/sigmah.properties', 'mail.support.to=', email) replace_file_line('/srv/sigmah/conf/sigmah.properties', 'mail.support.to=', email)
# Ushahidi # Ushahidi
if app_exists('ushahidi'): if app_exists('ushahidi'):
email_json = '{\\"incoming_type\\":\\"IMAP\\",\\"incoming_server\\":\\"localhost\\",\\"incoming_port\\":143,\\"incoming_security\\":\\"None\\",\\"incoming_username\\":\\"{}\\",\\"incoming_password\\":\\"password\\",\\"outgoing_type\\":\\"SMTP\\",\\"outgoing_server\\":\\"postfix\\",\\"outgoing_port\\":25,\\"outgoing_security\\":\\"None\\",\\"outgoing_username\\":\\"{}\\",\\"outgoing_password\\":\\"password\\",\\"from\\":\\"{}\\",\\"from_name\\":\\"Ushahidi\\"}'.format(email, email, email) email_json = '{{\\"incoming_type\\":\\"IMAP\\",\\"incoming_server\\":\\"localhost\\",\\"incoming_port\\":143,\\"incoming_security\\":\\"None\\",\\"incoming_username\\":\\"{}\\",\\"incoming_password\\":\\"password\\",\\"outgoing_type\\":\\"SMTP\\",\\"outgoing_server\\":\\"postfix\\",\\"outgoing_port\\":25,\\"outgoing_security\\":\\"None\\",\\"outgoing_username\\":\\"{}\\",\\"outgoing_password\\":\\"password\\",\\"from\\":\\"{}\\",\\"from_name\\":\\"Ushahidi\\"}}'.format(email, email, email)
query = 'UPDATE `config` SET `config_value` = "{}" WHERE `group_name` LIKE "data-provider" AND `config_key` LIKE "email";'.format(email_json) query = 'UPDATE `config` SET `config_value` = "{}" WHERE `group_name` LIKE "data-provider" AND `config_key` LIKE "email";'.format(email_json)
run_mysql_query(query, 'ushahidi') run_mysql_query(query, 'ushahidi')
query = 'UPDATE `config` SET `config_value` = "\"{}\"" WHERE `group_name` LIKE "site" AND `config_key` LIKE "email";'.format(email) query = 'UPDATE `config` SET `config_value` = "\\"{}\\"" WHERE `group_name` LIKE "site" AND `config_key` LIKE "email";'.format(email)
run_mysql_query(query, 'ushahidi') run_mysql_query(query, 'ushahidi')
def update_url(host): def update_url(host):