add toString method to frappe.user

This commit is contained in:
Faris Ansari 2017-06-01 14:13:27 +05:30
parent e1b243996a
commit dec7b337c6

View file

@ -141,6 +141,19 @@ $.extend(frappe.user, {
quote: quote
});
}
},
/* Normally frappe.user is an object
* having properties and methods.
* But in the following case
*
* if (frappe.user === 'Administrator')
*
* frappe.user will cast to a string
* returning frappe.user.name
*/
toString: function() {
return this.name;
}
});