Set gravatar for users whose image is missing

This commit is contained in:
Anand Doshi 2014-05-14 13:45:02 +05:30
parent dd93e2b354
commit da26421eeb
2 changed files with 12 additions and 0 deletions

View file

@ -29,3 +29,4 @@ frappe.patches.v4_0.file_manager_hooks
execute:frappe.get_doc("User", "Guest").save()
frappe.patches.v4_0.deprecate_link_selects
frappe.patches.v4_0.set_language_in_system_settings
frappe.patches.v4_0.set_user_gravatar

View file

@ -0,0 +1,11 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for name in frappe.db.sql_list("select name from `tabUser` where ifnull(user_image, '')=''"):
user = frappe.get_doc("User", name)
user.update_gravatar()
user.db_set("user_image", user.user_image)