Browse Source

Merge pull request #10228 from surajshetty3416/run-patch

version-14
Suraj Shetty 5 years ago
committed by GitHub
parent
commit
89a5503447
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 12 deletions
  1. +1
    -0
      frappe/patches.txt
  2. +1
    -11
      frappe/patches/v13_0/migrate_translation_column_data.py
  3. +1
    -1
      frappe/patches/v13_0/set_read_times.py

+ 1
- 0
frappe/patches.txt View File

@@ -277,3 +277,4 @@ frappe.patches.v13_0.set_existing_dashboard_charts_as_public
frappe.patches.v13_0.set_path_for_homepage_in_web_page_view
frappe.patches.v13_0.migrate_translation_column_data
frappe.patches.v13_0.set_read_times
frappe.patches.v13_0.remove_web_view

+ 1
- 11
frappe/patches/v13_0/migrate_translation_column_data.py View File

@@ -2,14 +2,4 @@ import frappe

def execute():
frappe.reload_doctype('Translation')
frappe.db.sql("""
UPDATE `tabTranslation`
SET
translated_text=target_name,
source_text=source_name,
contribution_status=(CASE status
WHEN 'Deleted' THEN 'Rejected'
ELSE ''
END),
contributed=0
""")
frappe.db.sql("UPDATE `tabTranslation` SET `translated_text`=`target_name`, `source_text`=`source_name`, `contributed`=0")

+ 1
- 1
frappe/patches/v13_0/set_read_times.py View File

@@ -14,5 +14,5 @@ def get_read_time(blog):
if blog.content_type == "Markdown":
content = markdown(blog.content_md)

total_words = len(strip_html_tags(content).split())
total_words = len(strip_html_tags(content or "").split())
return ceil(total_words/250)

Loading…
Cancel
Save