Merge branch 'version-13-hotfix' into e-commerce-refactor

This commit is contained in:
Marica
2021-09-02 10:25:14 +05:30
committed by GitHub
120 changed files with 1551 additions and 1291 deletions

View File

@@ -60,9 +60,6 @@ class EmailDigest(Document):
reference_name = self.name,
unsubscribe_message = _("Unsubscribe from this Email Digest"))
frappe.set_user(original_user)
frappe.set_user_lang(original_user)
def get_msg_html(self):
"""Build email digest content"""
frappe.flags.ignore_account_permission = True

View File

@@ -79,7 +79,8 @@ class NamingSeries(Document):
options = self.scrub_options_list(ol)
# validate names
for i in options: self.validate_series_name(i)
for i in options:
self.validate_series_name(i)
if options and self.user_must_always_select:
options = [''] + options
@@ -138,7 +139,7 @@ class NamingSeries(Document):
def validate_series_name(self, n):
import re
if not re.match("^[\w\- /.#{}]*$", n, re.UNICODE):
if not re.match(r"^[\w\- \/.#{}]+$", n, re.UNICODE):
throw(_('Special Characters except "-", "#", ".", "/", "{" and "}" not allowed in naming series'))
@frappe.whitelist()

View File

@@ -106,7 +106,7 @@ def fin(args):
def make_sample_data(domains):
try:
sample_data.make_sample_data(domains)
except:
except Exception:
# clear message
if frappe.message_log:
frappe.message_log.pop()

View File

@@ -109,7 +109,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
value = response.json()["result"]
cache.setex(name=key, time=21600, value=flt(value))
return flt(value)
except:
except Exception:
frappe.log_error(title="Get Exchange Rate")
frappe.msgprint(_("Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually").format(from_currency, to_currency, transaction_date))
return 0.0