Hi,
I have installed mydata-sdk using docker and I was able to open the corresponding web page http://127.0.0.1:8080.
However, when creating a new user account (sign-up), I was getting the following error:
2016-11-22 14:46:51,118 - app.mod_database.helpers in function log_query at line: 27 - DEBUG - SQL query to execute: "INSERT INTO MyDataAccount.Particulars (firstname, lastname, dateOfBirth, img_url, Accounts_id) VALUES (test, test, STR_TO_DATE(22-11-2016, '%Y-%m-%d'), img/avatars/mydata-avatar.png, 1)" 2016-11-22 14:46:51,118 - app.mod_database.helpers in function execute_sql_insert_2 at line: 98 - DEBUG - Error in SQL query execution: OperationalError(1292, "Truncated incorrect date value: '22-11-2016'")
I was able to fix the bug, by updating the lines "STR_TO_DATE(%s, '%%Y-%%m-%%d')" to "STR_TO_DATE(%s, '%%d-%%m-%%Y')" in the following file: Account/app/mod_database/models.py
Then, after having successfully created a new account, I'm getting the below error message when I try to login:
2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_username_and_password at line: 157 - DEBUG - Authenticated 2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_id at line: 25 - DEBUG - User info by acoount_id 2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_id at line: 27 - DEBUG - account_id: 1 2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_id at line: 48 - DEBUG - sql_query: "SELECT MyDataAccount.Accounts.id, MyDataAccount.LocalIdentities.id, MyDataAccount.LocalIdentities.username, MyDataAccount.Particulars.firstname, MyDataAccount.Particulars.lastname, MyDataAccount.Emails.email, MyDataAccount.Particulars.img_url, MyDataAccount.Particulars.dateOfBirth FROM MyDataAccount.Accounts INNER JOIN MyDataAccount.LocalIdentities ON MyDataAccount.Accounts.id = MyDataAccount.LocalIdentities.Accounts_id INNER JOIN MyDataAccount.Particulars ON MyDataAccount.Accounts.id = MyDataAccount.Particulars.Accounts_id INNER JOIN MyDataAccount.Emails ON MyDataAccount.Accounts.id = MyDataAccount.Emails.Accounts_id WHERE MyDataAccount.Accounts.id = '1' AND MyDataAccount.Emails.prime = 1" 2016-11-22 14:50:02,302 - mod_auth_helpers in function get_account_by_id at line: 54 - DEBUG - data: None 2016-11-22 14:50:02,302 - mod_auth_helpers in function get_account_by_id at line: 66 - DEBUG - Account not found: TypeError("'NoneType' object has no attribute '__getitem__'",) 2016-11-22 14:50:02,303 - mod_auth_helpers in function get_account_by_id at line: 69 - DEBUG - Exception: TypeError("'NoneType' object has no attribute '__getitem__'",) 2016-11-22 14:50:02,303 - mod_auth_controllers in function post at line: 59 - DEBUG - registered_user: None
Hi,
I have installed mydata-sdk using docker and I was able to open the corresponding web page http://127.0.0.1:8080.
However, when creating a new user account (sign-up), I was getting the following error:
2016-11-22 14:46:51,118 - app.mod_database.helpers in function log_query at line: 27 - DEBUG - SQL query to execute: "INSERT INTO MyDataAccount.Particulars (firstname, lastname, dateOfBirth, img_url, Accounts_id) VALUES (test, test, STR_TO_DATE(22-11-2016, '%Y-%m-%d'), img/avatars/mydata-avatar.png, 1)" 2016-11-22 14:46:51,118 - app.mod_database.helpers in function execute_sql_insert_2 at line: 98 - DEBUG - Error in SQL query execution: OperationalError(1292, "Truncated incorrect date value: '22-11-2016'")I was able to fix the bug, by updating the lines "STR_TO_DATE(%s, '%%Y-%%m-%%d')" to "STR_TO_DATE(%s, '%%d-%%m-%%Y')" in the following file: Account/app/mod_database/models.py
Then, after having successfully created a new account, I'm getting the below error message when I try to login:
2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_username_and_password at line: 157 - DEBUG - Authenticated 2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_id at line: 25 - DEBUG - User info by acoount_id 2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_id at line: 27 - DEBUG - account_id: 1 2016-11-22 14:50:02,301 - mod_auth_helpers in function get_account_by_id at line: 48 - DEBUG - sql_query: "SELECT MyDataAccount.Accounts.id, MyDataAccount.LocalIdentities.id, MyDataAccount.LocalIdentities.username, MyDataAccount.Particulars.firstname, MyDataAccount.Particulars.lastname, MyDataAccount.Emails.email, MyDataAccount.Particulars.img_url, MyDataAccount.Particulars.dateOfBirth FROM MyDataAccount.Accounts INNER JOIN MyDataAccount.LocalIdentities ON MyDataAccount.Accounts.id = MyDataAccount.LocalIdentities.Accounts_id INNER JOIN MyDataAccount.Particulars ON MyDataAccount.Accounts.id = MyDataAccount.Particulars.Accounts_id INNER JOIN MyDataAccount.Emails ON MyDataAccount.Accounts.id = MyDataAccount.Emails.Accounts_id WHERE MyDataAccount.Accounts.id = '1' AND MyDataAccount.Emails.prime = 1" 2016-11-22 14:50:02,302 - mod_auth_helpers in function get_account_by_id at line: 54 - DEBUG - data: None 2016-11-22 14:50:02,302 - mod_auth_helpers in function get_account_by_id at line: 66 - DEBUG - Account not found: TypeError("'NoneType' object has no attribute '__getitem__'",) 2016-11-22 14:50:02,303 - mod_auth_helpers in function get_account_by_id at line: 69 - DEBUG - Exception: TypeError("'NoneType' object has no attribute '__getitem__'",) 2016-11-22 14:50:02,303 - mod_auth_controllers in function post at line: 59 - DEBUG - registered_user: None