fix: Compatibility fixes for Frappe v13, develop & Py3

This commit is contained in:
Gavin D'souza
2021-12-01 11:50:27 +05:30
parent 92353efe4e
commit c1170848c1
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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):

View File

@@ -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