From 54b3a32968b8ab9a41fcdc1aa7d9c0aa937bd4c4 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 25 Jan 2022 16:19:49 +0530 Subject: [PATCH 1/2] fix: get timezone in user_info --- cypress/integration/datetime.js | 1 + frappe/utils/__init__.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/integration/datetime.js b/cypress/integration/datetime.js index ef1952dc94..4a24faf40b 100644 --- a/cypress/integration/datetime.js +++ b/cypress/integration/datetime.js @@ -103,6 +103,7 @@ context('Control Date, Time and DateTime', () => { input_value: '12-02-2019 11:00' // admin timezone (Asia/Kolkata) } ]; + datetime_formats.forEach(d => { it(`test datetime format ${d.date_format} ${d.time_format}`, () => { cy.set_value('System Settings', 'System Settings', { diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index 351c0413ce..9deec0a77c 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -901,10 +901,11 @@ def dictify(arg): def add_user_info(user, user_info): if user not in user_info: info = frappe.db.get_value("User", - user, ["full_name", "user_image", "name", 'email'], as_dict=True) or frappe._dict() + user, ["full_name", "user_image", "name", 'email', 'time_zone'], as_dict=True) or frappe._dict() user_info[user] = frappe._dict( fullname = info.full_name or user, image = info.user_image, name = user, - email = info.email + email = info.email, + time_zone = info.time_zone ) From 8ff0a3029dde273f29685ba845b761c39fcbec9f Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 25 Jan 2022 17:01:38 +0530 Subject: [PATCH 2/2] test: flaky timeline_email fix --- cypress/integration/timeline_email.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/integration/timeline_email.js b/cypress/integration/timeline_email.js index 1b7634d211..5808bd52ef 100644 --- a/cypress/integration/timeline_email.js +++ b/cypress/integration/timeline_email.js @@ -14,7 +14,7 @@ context('Timeline Email', () => { cy.wait(700); }); - it('Adding email and verifying timeline content for email attachment, deleting attachment and ToDo', () => { + it('Adding email and verifying timeline content for email attachment', () => { cy.visit('/app/todo'); cy.get('.list-row > .level-left > .list-subject').eq(0).click(); @@ -43,7 +43,9 @@ context('Timeline Email', () => { cy.get('#page-Communication > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .btn').click(); cy.get('#page-Communication > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .dropdown-menu > li > .grey-link').eq(9).click(); cy.get('.modal.show > .modal-dialog > .modal-content > .modal-footer > .standard-actions > .btn-primary').click(); + }); + it('Deleting attachment and ToDo', () => { cy.visit('/app/todo'); cy.get('.list-row > .level-left > .list-subject > .level-item.ellipsis > .ellipsis').eq(0).click();