From 1e565ad066039d8d3eb686a56ed71ba28043d237 Mon Sep 17 00:00:00 2001 From: shariquerik Date: Mon, 1 Feb 2021 14:07:05 +0530 Subject: [PATCH 01/10] fix: On Event creation assign to not working --- frappe/public/js/frappe/views/interaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/interaction.js b/frappe/public/js/frappe/views/interaction.js index 6f694801a6..ccb0b3cdc2 100644 --- a/frappe/public/js/frappe/views/interaction.js +++ b/frappe/public/js/frappe/views/interaction.js @@ -261,7 +261,7 @@ frappe.views.InteractionComposer = class InteractionComposer { args: { doctype: doc.doctype, name: doc.name, - assign_to: assignee, + assign_to: `["${assignee}"]`, }, callback:function(r) { if(!r.exc) { From 62889993fb61765a41ff2f47b01275e711179c2d Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 1 Feb 2021 17:50:02 +0530 Subject: [PATCH 02/10] fix: validate the key type while updating the password --- frappe/core/doctype/user/user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index dcca4f4a25..73e0f1c799 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -565,6 +565,10 @@ def get_perm_info(role): @frappe.whitelist(allow_guest=True) def update_password(new_password, logout_all_sessions=0, key=None, old_password=None): + #validate key to avoid key input like ['like', '%'], '', ['in', ['']] + if key and not isinstance(key, str): + frappe.throw(_('Invalid key type')) + result = test_password_strength(new_password, key, old_password) feedback = result.get("feedback", None) From 75f9eeeeaa1bc81d828a24a2d49b50280713dd2b Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 2 Feb 2021 12:31:13 +0530 Subject: [PATCH 03/10] fix: reload workspace link in patch --- frappe/patches/v13_0/rename_desk_page_to_workspace.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/patches/v13_0/rename_desk_page_to_workspace.py b/frappe/patches/v13_0/rename_desk_page_to_workspace.py index 10308e8e53..36626815db 100644 --- a/frappe/patches/v13_0/rename_desk_page_to_workspace.py +++ b/frappe/patches/v13_0/rename_desk_page_to_workspace.py @@ -17,3 +17,4 @@ def execute(): rename_doc('DocType', 'Desk Link', 'Workspace Link', ignore_if_exists=True) frappe.reload_doc('desk', 'doctype', 'workspace') + frappe.reload_doc('desk', 'doctype', 'workspace_link') From 69d942a488ca92f955f2fb2e55d8b6b0451cb9f2 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 2 Feb 2021 15:59:42 +0530 Subject: [PATCH 04/10] fix: reload modified patch --- frappe/patches.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/patches.txt b/frappe/patches.txt index 8e8644342e..f076d5bd9c 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -327,5 +327,5 @@ execute:frappe.delete_doc_if_exists('Page', 'workspace') execute:frappe.delete_doc_if_exists('Page', 'dashboard', force=1) frappe.core.doctype.page.patches.drop_unused_pages execute:frappe.get_doc('Role', 'Guest').save() # remove desk access -frappe.patches.v13_0.rename_desk_page_to_workspace +frappe.patches.v13_0.rename_desk_page_to_workspace # 02.02.2021 frappe.patches.v13_0.delete_package_publish_tool From 8985130c807abbe3cdf8cc831119cd508beb7d6e Mon Sep 17 00:00:00 2001 From: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> Date: Tue, 2 Feb 2021 16:27:52 +0530 Subject: [PATCH 05/10] Update frappe/public/js/frappe/views/interaction.js Co-authored-by: Prssanna Desai --- frappe/public/js/frappe/views/interaction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/interaction.js b/frappe/public/js/frappe/views/interaction.js index ccb0b3cdc2..ab7570b5c5 100644 --- a/frappe/public/js/frappe/views/interaction.js +++ b/frappe/public/js/frappe/views/interaction.js @@ -261,7 +261,7 @@ frappe.views.InteractionComposer = class InteractionComposer { args: { doctype: doc.doctype, name: doc.name, - assign_to: `["${assignee}"]`, + assign_to: JSON.stringify([assignee]), }, callback:function(r) { if(!r.exc) { @@ -336,4 +336,4 @@ function get_doc_mappings() { }; return doc_map; -} \ No newline at end of file +} From 99fe0412b301254552cd2ce3fa3c22f85d160045 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Tue, 2 Feb 2021 17:39:05 +0530 Subject: [PATCH 06/10] fix(patch): Pass if table is missing (#12302) --- frappe/desk/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe/desk/utils.py b/frappe/desk/utils.py index c19e531739..01b47ac106 100644 --- a/frappe/desk/utils.py +++ b/frappe/desk/utils.py @@ -7,12 +7,13 @@ def validate_route_conflict(doctype, name): ''' Raises exception if name clashes with routes from other documents for /app routing ''' - if frappe.flags.ignore_route_conflict_validation: - return all_names = [] for _doctype in ['Page', 'Workspace', 'DocType']: - all_names.extend([slug(d) for d in frappe.get_all(_doctype, pluck='name') if (doctype != _doctype and d != name)]) + try: + all_names.extend([slug(d) for d in frappe.get_all(_doctype, pluck='name') if (doctype != _doctype and d != name)]) + except frappe.db.TableMissingError: + pass if slug(name) in all_names: frappe.msgprint(frappe._('Name already taken, please set a new name')) From 3504fcf7b44f95ea130d993e246449775410bd54 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 2 Feb 2021 18:08:06 +0530 Subject: [PATCH 07/10] fix: Desk Page rename patch --- frappe/patches/v13_0/rename_desk_page_to_workspace.py | 5 +++-- .../patches/v13_0/update_icons_in_customized_desk_pages.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frappe/patches/v13_0/rename_desk_page_to_workspace.py b/frappe/patches/v13_0/rename_desk_page_to_workspace.py index 36626815db..1801c4cf61 100644 --- a/frappe/patches/v13_0/rename_desk_page_to_workspace.py +++ b/frappe/patches/v13_0/rename_desk_page_to_workspace.py @@ -13,8 +13,9 @@ def execute(): rename_doc('DocType', 'Desk Chart', 'Workspace Chart', ignore_if_exists=True) rename_doc('DocType', 'Desk Shortcut', 'Workspace Shortcut', ignore_if_exists=True) - if frappe.db.exists('DocType', 'Desk Link'): - rename_doc('DocType', 'Desk Link', 'Workspace Link', ignore_if_exists=True) + rename_doc('DocType', 'Desk Link', 'Workspace Link', ignore_if_exists=True) frappe.reload_doc('desk', 'doctype', 'workspace') frappe.reload_doc('desk', 'doctype', 'workspace_link') + frappe.reload_doc('desk', 'doctype', 'workspace_chart') + frappe.reload_doc('desk', 'doctype', 'workspace_shortcut') diff --git a/frappe/patches/v13_0/update_icons_in_customized_desk_pages.py b/frappe/patches/v13_0/update_icons_in_customized_desk_pages.py index da7d054682..93bf5c766e 100644 --- a/frappe/patches/v13_0/update_icons_in_customized_desk_pages.py +++ b/frappe/patches/v13_0/update_icons_in_customized_desk_pages.py @@ -2,6 +2,8 @@ from __future__ import unicode_literals import frappe def execute(): + if not frappe.db.exists('Desk Page'): return + pages = frappe.get_all("Desk Page", filters={ "is_standard": False }, fields=["name", "extends", "for_user"]) default_icon = {} for page in pages: From bdcb769c188aa09222d0945d0af717c78461241c Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 2 Feb 2021 18:17:02 +0530 Subject: [PATCH 08/10] fix: Check if css file exists --- frappe/email/email_body.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/email/email_body.py b/frappe/email/email_body.py index 7aa70830e7..3fb1dfa0da 100755 --- a/frappe/email/email_body.py +++ b/frappe/email/email_body.py @@ -297,8 +297,9 @@ def inline_style_in_html(html): for app in apps: path = 'assets/{0}/css/email.css'.format(app) - if os.path.exists(os.path.abspath(path)): - css_files.append(path) + css_files.append(path) + + css_files = [css_file for css_file in css_files if os.path.exists(os.path.abspath(css_file))] p = Premailer(html=html, external_styles=css_files, strip_important=False) From 5efe3a3bae462387eef1e7f6feff06491c91ceba Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 2 Feb 2021 20:31:22 +0530 Subject: [PATCH 09/10] fix(patch): Force reload Workspace doctypes Reload after rename doc doesn't actually update the workspace doctypes. Fixing by adding the force flag. --- frappe/patches/v13_0/rename_desk_page_to_workspace.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/patches/v13_0/rename_desk_page_to_workspace.py b/frappe/patches/v13_0/rename_desk_page_to_workspace.py index 1801c4cf61..6483fc380c 100644 --- a/frappe/patches/v13_0/rename_desk_page_to_workspace.py +++ b/frappe/patches/v13_0/rename_desk_page_to_workspace.py @@ -15,7 +15,7 @@ def execute(): rename_doc('DocType', 'Desk Shortcut', 'Workspace Shortcut', ignore_if_exists=True) rename_doc('DocType', 'Desk Link', 'Workspace Link', ignore_if_exists=True) - frappe.reload_doc('desk', 'doctype', 'workspace') - frappe.reload_doc('desk', 'doctype', 'workspace_link') - frappe.reload_doc('desk', 'doctype', 'workspace_chart') - frappe.reload_doc('desk', 'doctype', 'workspace_shortcut') + frappe.reload_doc('desk', 'doctype', 'workspace', force=True) + frappe.reload_doc('desk', 'doctype', 'workspace_link', force=True) + frappe.reload_doc('desk', 'doctype', 'workspace_chart', force=True) + frappe.reload_doc('desk', 'doctype', 'workspace_shortcut', force=True) From de0f7fd9d9c4fc129ff916f27db9ae3bb6bd0c68 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 2 Feb 2021 19:28:31 +0530 Subject: [PATCH 10/10] docs: update docstring of top level module --- frappe/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index 95d9c782a4..9b3ffc4662 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -1,8 +1,14 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """ -globals attached to frappe module -+ some utility functions that should probably be moved +Frappe - Low Code Open Source Framework in Python and JS + +Frappe, pronounced fra-pay, is a full stack, batteries-included, web +framework written in Python and Javascript with MariaDB as the database. +It is the framework which powers ERPNext. It is pretty generic and can +be used to build database driven apps. + +Read the documentation: https://frappeframework.com/docs """ from __future__ import unicode_literals, print_function