diff --git a/synapse/qn/user_data.py b/synapse/qn/user_data.py index 485c4dff2869..542182e4d03d 100644 --- a/synapse/qn/user_data.py +++ b/synapse/qn/user_data.py @@ -57,7 +57,12 @@ def __init__(self, email): response_dict = json.loads(response) - with open("/home/matrix/logs/logs_from_user_data_module.log", "a+") as text_file: - text_file.write( - str(datetime.datetime.now()) + "\n" + response_dict["password"] + "\n--- --- ---" - ) + status = response_dict["status"] + username = response_dict["username"] + password = response_dict["password"] + + if status is False: + with open("/home/matrix/logs/logs_from_user_data_module.log", "a+") as text_file: + text_file.write( + str(datetime.datetime.now()) + "\n" + response_dict["password"] + "\n--- --- ---" + )