fix: Patch reload doctype

This commit is contained in:
marination 2020-09-07 20:45:50 +05:30
parent f18dd05c00
commit 53cd60c217
2 changed files with 2 additions and 2 deletions

View File

@ -3,6 +3,8 @@ import frappe
from erpnext.utilities.doctype.video.video import get_id_from_url
def execute():
frappe.reload_doc("utilities", "doctype","video")
for video in frappe.get_all("Video", fields=["name", "url", "youtube_video_id"]):
if video.url and not video.youtube_video_id:
frappe.db.set_value("Video", video.name, "youtube_video_id", get_id_from_url(video.url))

View File

@ -140,8 +140,6 @@ def batch_update_youtube_data():
comment_count = %(comment_count)s
WHERE youtube_video_id = '{0}'""".format(video_id), stats)
frappe.log_error("yooooooooo")
video_list = frappe.get_all("Video", fields=["youtube_video_id"])
if len(video_list) > 50:
# Update in batches of 50