Merge pull request #7735 from adityahase/fix-login-notification-new

fix: Trigger notifications after updating last_login, last_ip fields
This commit is contained in:
Rushabh Mehta 2019-06-20 11:18:48 +05:30 committed by GitHub
commit d8a75d08be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,6 +231,7 @@ class Session:
self.insert_session_record()
# update user
user = frappe.get_doc("User", self.data['user'])
frappe.db.sql("""UPDATE `tabUser`
SET
last_login = %(now)s,
@ -241,7 +242,8 @@ class Session:
'ip': frappe.local.request_ip,
'name': self.data['user']
})
user.run_notifications("before_change")
user.run_notifications("on_update")
frappe.db.commit()
def insert_session_record(self):