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 diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index 5a35907ccf..142cc1ee26 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -562,6 +562,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) 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')) 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) 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 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..6483fc380c 100644 --- a/frappe/patches/v13_0/rename_desk_page_to_workspace.py +++ b/frappe/patches/v13_0/rename_desk_page_to_workspace.py @@ -13,7 +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', 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) 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: diff --git a/frappe/public/js/frappe/views/interaction.js b/frappe/public/js/frappe/views/interaction.js index 579fa653f9..119eba13fb 100644 --- a/frappe/public/js/frappe/views/interaction.js +++ b/frappe/public/js/frappe/views/interaction.js @@ -259,7 +259,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) { @@ -334,4 +334,4 @@ function get_doc_mappings() { }; return doc_map; -} \ No newline at end of file +}