Merge pull request #10228 from surajshetty3416/run-patch

This commit is contained in:
Suraj Shetty 2020-05-05 11:04:29 +05:30 committed by GitHub
commit 89a5503447
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 12 deletions

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

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")

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)