Merge branch 'hotfix'

This commit is contained in:
Nabin Hait 2017-02-28 18:42:06 +05:30
commit d1e573dba8
3 changed files with 16 additions and 3 deletions

View file

@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template
__version__ = '7.2.21'
__version__ = '7.2.22'
__title__ = "Frappe Framework"
local = Local()

View file

@ -27,6 +27,7 @@ frappe.Application = Class.extend({
this.load_bootinfo();
this.make_nav_bar();
this.set_favicon();
this.setup_analytics();
frappe.ui.keys.setup();
this.set_rtl();
@ -276,6 +277,18 @@ frappe.Application = Class.extend({
};
},
setup_analytics: function() {
if(window.mixpanel) {
window.mixpanel.identify(frappe.session.user);
window.mixpanel.people.set({
"$first_name": frappe.boot.user.first_name,
"$last_name": frappe.boot.user.last_name,
"$created": frappe.boot.user.creation,
"$email": frappe.session.user
});
}
},
show_notes: function() {
var me = this;
if(frappe.boot.notes.length) {

View file

@ -189,7 +189,7 @@ class UserPermissions:
return self.can_read
def load_user(self):
d = frappe.db.sql("""select email, first_name, last_name,
d = frappe.db.sql("""select email, first_name, last_name, creation,
email_signature, user_type, language, background_image, background_style, mute_sounds
from tabUser where name = %s""", (self.name,), as_dict=1)[0]
@ -344,7 +344,7 @@ def disable_users(limits=None):
frappe.db.set_value("User", user, 'enabled', 0)
from frappe.core.doctype.user.user import get_total_users
if get_total_users() > cint(limits.get('users')):
reset_simultaneous_sessions(cint(limits.get('users')))