소스 검색

[fix] patches

version-14
Rushabh Mehta 8 년 전
부모
커밋
28b38d45e7
7개의 변경된 파일14개의 추가작업 그리고 5개의 파일을 삭제
  1. +2
    -0
      frappe/migrate.py
  2. +1
    -1
      frappe/modules/patch_handler.py
  3. +1
    -0
      frappe/patches.txt
  4. +5
    -2
      frappe/patches/v7_2/update_communications.py
  5. +2
    -1
      frappe/patches/v8_0/update_published_in_global_search.py
  6. +2
    -1
      frappe/website/context.py
  7. +1
    -0
      frappe/www/error.py

+ 2
- 0
frappe/migrate.py 파일 보기

@@ -24,6 +24,7 @@ def migrate(verbose=True, rebuild_website=False):
- sync fixtures
- sync desktop icons
- sync web pages (from /www)'''
frappe.flags.in_migrate = True
clear_global_cache()

# run patches
@@ -53,3 +54,4 @@ def migrate(verbose=True, rebuild_website=False):
clear_notifications()

frappe.publish_realtime("version-update")
frappe.flags.in_migrate = False

+ 1
- 1
frappe/modules/patch_handler.py 파일 보기

@@ -98,7 +98,7 @@ def execute_patch(patchmodule, method=None, methodargs=None):

def update_patch_log(patchmodule):
"""update patch_file in patch log"""
frappe.get_doc({"doctype": "Patch Log", "patch": patchmodule}).insert()
frappe.get_doc({"doctype": "Patch Log", "patch": patchmodule}).insert(ignore_permissions=True)

def executed(patchmodule):
"""return True if is executed"""


+ 1
- 0
frappe/patches.txt 파일 보기

@@ -1,6 +1,7 @@
execute:frappe.db.sql("""update `tabPatch Log` set patch=replace(patch, '.4_0.', '.v4_0.')""") #2014-05-12
frappe.patches.v5_0.convert_to_barracuda_and_utf8mb4
execute:frappe.utils.global_search.setup_global_search_table()
frappe.patches.v8_0.update_global_search_table
frappe.patches.v7_0.update_auth
frappe.patches.v7_1.rename_scheduler_log_to_error_log
frappe.patches.v7_3.rename_page_role_to_has_role


+ 5
- 2
frappe/patches/v7_2/update_communications.py 파일 보기

@@ -8,8 +8,11 @@ def execute():
"""

frappe.reload_doc("core", "doctype", "feedback_request")
frappe.db.sql("""update tabCommunication set content=ifnull(feedback, "feedback details not provided")
where communication_type="Feedback" and content is NULL""")
frappe.reload_doc("core", "doctype", "communication")

if frappe.db.has_column('Communication', 'feedback'):
frappe.db.sql("""update tabCommunication set content=ifnull(feedback, "feedback details not provided")
where communication_type="Feedback" and content is NULL""")

frappe.db.sql(""" update tabCommunication set sender_full_name="" where communication_type="Feedback"
and sender_full_name='Guest None' """)


+ 2
- 1
frappe/patches/v8_0/update_published_in_global_search.py 파일 보기

@@ -1,8 +1,9 @@
import frappe
from frappe.utils.global_search import rebuild_for_doctype

def execute():
from frappe.website.router import get_doctypes_with_web_view
from frappe.utils.global_search import rebuild_for_doctype

if not 'published' in frappe.db.get_db_table_columns('__global_search'):
frappe.db.sql('''alter table __global_search
add column `title` varchar(140)''')


+ 2
- 1
frappe/website/context.py 파일 보기

@@ -51,7 +51,8 @@ def update_controller_context(context, controller):
except frappe.PermissionError:
raise
except:
frappe.errprint(frappe.utils.get_traceback())
if not frappe.flags.in_migrate:
frappe.errprint(frappe.utils.get_traceback())

if hasattr(module, "get_children"):
context.children = module.get_children(context)


+ 1
- 0
frappe/www/error.py 파일 보기

@@ -8,5 +8,6 @@ no_cache = 1
no_sitemap = 1

def get_context(context):
if frappe.flags.in_migrate: return
print frappe.get_traceback().encode("utf-8")
return {"error": frappe.get_traceback().replace("<", "&lt;").replace(">", "&gt;") }

불러오는 중...
취소
저장