From 16e96b14f863dc3db7b0b3100c72cb585f18a137 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 20 Apr 2020 12:43:01 +0530 Subject: [PATCH 1/5] fix: message on reset password --- frappe/www/update-password.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/www/update-password.html b/frappe/www/update-password.html index f0ee0688d4..34e5ea137d 100644 --- a/frappe/www/update-password.html +++ b/frappe/www/update-password.html @@ -57,11 +57,11 @@ frappe.ready(function() { } if(!args.old_password && !args.key) { - frappe.msgprint("{{ _("Old Password Required.") }}"); + frappe.msgprint("{{ _('Old Password Required.') }}"); return; } if(!args.new_password) { - frappe.msgprint("{{ _("New Password Required.") }}"); + frappe.msgprint("{{ _('New Password Required.') }}"); return; } frappe.call({ @@ -79,11 +79,11 @@ frappe.ready(function() { strength_indicator.addClass('hidden'); strength_message.addClass('hidden'); $('.page-card-head .indicator') - .removeClass().addClass('indicator green') - .html("{{ _('Password Updated') }}"); + .removeClass().addClass('indicator blue') + .html("{{ _('Status Updated') }}"); if(r.message) { frappe.msgprint({ - message: "{{ _("Password Updated") }}", + message: `{{ _('${r.message}') }}`, // password is updated successfully // clear any server message clear: true From 27b5819e3466ad254edb7262800a8589efb9d231 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 22 Apr 2020 11:55:46 +0530 Subject: [PATCH 2/5] fix: skip validation if oldfieldtype is not set to data Signed-off-by: Chinmay D. Pai --- frappe/model/base_document.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index ca6261076e..36f6970995 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -565,10 +565,14 @@ class BaseDocument(object): for data_field in self.meta.get_data_fields(): data = self.get(data_field.fieldname) data_field_options = data_field.get("options") + old_fieldtype = data_field.get("oldfieldtype") + + if old_fieldtype and old_fieldtype != "Data": + continue if data_field_options == "Email": if (self.owner in STANDARD_USERS) and (data in STANDARD_USERS): - return + continue for email_address in frappe.utils.split_emails(data): frappe.utils.validate_email_address(email_address, throw=True) From 919562e60e8e63cebdaca3e8ea951a83029a2f4f Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 22 Apr 2020 12:22:46 +0530 Subject: [PATCH 3/5] fix: skip data validation on creation if oldfieldtype is set Signed-off-by: Chinmay D. Pai --- frappe/core/doctype/doctype/doctype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index f7c9cbe28a..7306f90108 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -893,7 +893,7 @@ def validate_fields(meta): field.fetch_from = field.fetch_from.strip('\n').strip() def validate_data_field_type(docfield): - if docfield.fieldtype == "Data": + if docfield.fieldtype == "Data" and not (docfield.oldfieldtype and docfield.oldfieldtype != "Data"): if docfield.options and (docfield.options not in data_field_options): df_str = frappe.bold(_(docfield.label)) text_str = _("{0} is an invalid Data field.").format(df_str) + "
" * 2 + _("Only Options allowed for Data field are:") + "
" From e0d9cf50df83a0fe265aedea7920ca0a29f673f8 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 24 Apr 2020 18:32:03 +0530 Subject: [PATCH 4/5] fix: update password API mapping for /update-password --- frappe/www/update-password.html | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/frappe/www/update-password.html b/frappe/www/update-password.html index 34e5ea137d..d12be86d12 100644 --- a/frappe/www/update-password.html +++ b/frappe/www/update-password.html @@ -9,7 +9,7 @@ {{ _("Reset Password") if frappe.db.get_default('company') else _("Set Password")}}
-
+ @@ -32,8 +32,8 @@