From 488cff68bc833769b492c5ec120ef4a8c7da589d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 28 Feb 2017 18:41:16 +0530 Subject: [PATCH 1/2] [minor] update mixpanel analytics --- frappe/public/js/frappe/desk.js | 13 +++++++++++++ frappe/utils/user.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index f9c603ad9b..26ca555e49 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -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) { diff --git a/frappe/utils/user.py b/frappe/utils/user.py index 58f197c1d2..87426f5e9c 100755 --- a/frappe/utils/user.py +++ b/frappe/utils/user.py @@ -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'))) From c567869136ff3ec30d4c5970d1be2f2850877d07 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 28 Feb 2017 19:12:06 +0600 Subject: [PATCH 2/2] bumped to version 7.2.22 --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index 70b1ca0ffc..3d98448eda 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -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()