From c1170848c1287c3cdd0cd327c89da120a289ce1c Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 1 Dec 2021 11:50:27 +0530 Subject: [PATCH] fix: Compatibility fixes for Frappe v13, develop & Py3 --- .../doctype/esoc_applicant/esoc_applicant.py | 4 ++-- .../doctype/foundation_project/foundation_project.py | 2 +- .../doctype/service_provider/service_provider.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/foundation/erpnext_foundation/doctype/esoc_applicant/esoc_applicant.py b/foundation/erpnext_foundation/doctype/esoc_applicant/esoc_applicant.py index ddd14e17..100975c8 100644 --- a/foundation/erpnext_foundation/doctype/esoc_applicant/esoc_applicant.py +++ b/foundation/erpnext_foundation/doctype/esoc_applicant/esoc_applicant.py @@ -14,8 +14,8 @@ class ESoCApplicant(Document): self.validate_agreement_check() def validate_email_type(self, email): - from frappe.utils import validate_email_add - validate_email_add(email.strip(), True) + from frappe.utils import validate_email_address + validate_email_address(email.strip(), True) def validate_dob(self): from frappe.utils import now_datetime, getdate diff --git a/foundation/erpnext_foundation/doctype/foundation_project/foundation_project.py b/foundation/erpnext_foundation/doctype/foundation_project/foundation_project.py index e6ce66f6..2af31cf7 100644 --- a/foundation/erpnext_foundation/doctype/foundation_project/foundation_project.py +++ b/foundation/erpnext_foundation/doctype/foundation_project/foundation_project.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals # import frappe from frappe.model.document import Document -from frappe.website.render import clear_cache as clear_website_cache +from frappe.website.utils import clear_cache as clear_website_cache class FoundationProject(Document): def validate(self): diff --git a/foundation/erpnext_foundation/doctype/service_provider/service_provider.py b/foundation/erpnext_foundation/doctype/service_provider/service_provider.py index 912614fd..fbb3ed32 100644 --- a/foundation/erpnext_foundation/doctype/service_provider/service_provider.py +++ b/foundation/erpnext_foundation/doctype/service_provider/service_provider.py @@ -25,6 +25,6 @@ def get_last_login_diff(user): Returns difference between todays date and last login date """ last_login = frappe.db.get_value("User", user, ["last_login"]) - for x in xrange(1,10): + for x in range(1,10): print((get_datetime() - get_datetime(last_login)).days, user) return (get_datetime() - get_datetime(last_login)).days