Merge branch 'hotfix'
This commit is contained in:
commit
a757f227b4
2 changed files with 7 additions and 6 deletions
|
|
@ -24,7 +24,7 @@ if sys.version[0] == '2':
|
|||
reload(sys)
|
||||
sys.setdefaultencoding("utf-8")
|
||||
|
||||
__version__ = '11.1.19'
|
||||
__version__ = '11.1.20'
|
||||
__title__ = "Frappe Framework"
|
||||
|
||||
local = Local()
|
||||
|
|
|
|||
|
|
@ -226,11 +226,12 @@ class Session:
|
|||
self.insert_session_record()
|
||||
|
||||
# update user
|
||||
user = frappe.get_doc('User', self.data['user'])
|
||||
user.last_login = frappe.utils.now()
|
||||
user.last_ip = frappe.local.request_ip
|
||||
user.last_active = frappe.utils.now()
|
||||
user.save()
|
||||
frappe.db.sql("""UPDATE tabUser SET last_login = %(now)s, last_ip = %(ip)s, last_active = %(now)s
|
||||
where name=%(name)s""", {
|
||||
"now": frappe.utils.now(),
|
||||
"ip": frappe.local.request_ip,
|
||||
"name": self.data['user']
|
||||
})
|
||||
|
||||
frappe.db.commit()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue