mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
Merge pull request #477 from erpnext/compatibility-fixes
fix: Compatibility fixes for Frappe v13, develop & Py3
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.website.utils import get_comment_list
|
|
||||||
from frappe.utils import date_diff, nowdate, fmt_money, add_months
|
from frappe.utils import date_diff, nowdate, fmt_money, add_months
|
||||||
from frappe.website.utils import get_comment_list
|
from frappe.website.utils import get_comment_list
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestBounty(unittest.TestCase):
|
class TestBounty(unittest.TestCase):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestConferenceParticipant(unittest.TestCase):
|
class TestConferenceParticipant(unittest.TestCase):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class ConferenceSettings(Document):
|
class ConferenceSettings(Document):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestConferenceTalkProposal(unittest.TestCase):
|
class TestConferenceTalkProposal(unittest.TestCase):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestDeveloperSprint(unittest.TestCase):
|
class TestDeveloperSprint(unittest.TestCase):
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ class ESoCApplicant(Document):
|
|||||||
self.validate_agreement_check()
|
self.validate_agreement_check()
|
||||||
|
|
||||||
def validate_email_type(self, email):
|
def validate_email_type(self, email):
|
||||||
from frappe.utils import validate_email_add
|
from frappe.utils import validate_email_address
|
||||||
validate_email_add(email.strip(), True)
|
validate_email_address(email.strip(), True)
|
||||||
|
|
||||||
def validate_dob(self):
|
def validate_dob(self):
|
||||||
from frappe.utils import now_datetime, getdate
|
from frappe.utils import now_datetime, getdate
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class ESoCProjectDetail(Document):
|
class ESoCProjectDetail(Document):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestFoundationFellowship(unittest.TestCase):
|
class TestFoundationFellowship(unittest.TestCase):
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
# import frappe
|
# import frappe
|
||||||
from frappe.model.document import Document
|
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):
|
class FoundationProject(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
|
||||||
from frappe.website.website_generator import WebsiteGenerator
|
from frappe.website.website_generator import WebsiteGenerator
|
||||||
|
|
||||||
class FrappeApp(WebsiteGenerator):
|
class FrappeApp(WebsiteGenerator):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestFrappeApp(unittest.TestCase):
|
class TestFrappeApp(unittest.TestCase):
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
|
||||||
|
|
||||||
from frappe.website.website_generator import WebsiteGenerator
|
from frappe.website.website_generator import WebsiteGenerator
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# test_records = frappe.get_test_records('Portal Event')
|
# test_records = frappe.get_test_records('Portal Event')
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# test_records = frappe.get_test_records('Portal Job')
|
# test_records = frappe.get_test_records('Portal Job')
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ def get_last_login_diff(user):
|
|||||||
Returns difference between todays date and last login date
|
Returns difference between todays date and last login date
|
||||||
"""
|
"""
|
||||||
last_login = frappe.db.get_value("User", user, ["last_login"])
|
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)
|
print((get_datetime() - get_datetime(last_login)).days, user)
|
||||||
return (get_datetime() - get_datetime(last_login)).days
|
return (get_datetime() - get_datetime(last_login)).days
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# test_records = frappe.get_test_records('Service Provider')
|
# test_records = frappe.get_test_records('Service Provider')
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
import datetime
|
|
||||||
from frappe.utils import fmt_money
|
from frappe.utils import fmt_money
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
# do your magic here
|
# do your magic here
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import frappe
|
|
||||||
|
|
||||||
def migrate():
|
def migrate():
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
context.schedules = [
|
context.schedules = [
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import frappe
|
import frappe
|
||||||
import foundation
|
|
||||||
|
|
||||||
no_cache = 1
|
no_cache = 1
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
|
|||||||
Reference in New Issue
Block a user