Fix the disappears of image bug after uploading and saving the employee (#16217)

* Fix image disappears of image after uploading and saving the employee

* Fix the codacy issue
This commit is contained in:
Navdeep Ghai 2018-12-24 13:23:19 +04:00 committed by Rushabh Mehta
parent 91ddadeefa
commit c4d38c0afc

View File

@ -55,8 +55,8 @@ class Employee(NestedSet):
def validate_user_details(self):
data = frappe.db.get_value('User',
self.user_id, ['enabled', 'user_image'], as_dict=1)
self.image = data.get("user_image")
if data.get("user_image"):
self.image = data.get("user_image")
self.validate_for_enabled_user_id(data.get("enabled", 0))
self.validate_duplicate_user_id()