if max_users = 0, consider unlimited users

This commit is contained in:
Anand Doshi 2012-04-30 20:00:19 +05:30
parent 84777ac457
commit 4b2b159d12
2 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ $.extend(wn.pages.users, {
add_user: function() {
var me = wn.pages.users;
var active_users = $('.user-card:not(.disabled)');
if(wn.boot.max_users && (active_users.length >= wn.boot.max_users)) {
if(wn.boot.max_users && (active_users.length >= wn.boot.max_users) && wn.boot.max_users) {
msgprint(repl("Alas! <br />\
You already have <b>%(active_users)s</b> active users, \
which is the maximum number that you are currently allowed to add. <br /><br /> \

View File

@ -112,7 +112,7 @@ def add_profile(args):
active_users = sql("""select count(*) from tabProfile
where ifnull(enabled, 0)=1 and docstatus<2
and name not in ('Administrator', 'Guest')""")[0][0]
if active_users >= conf.max_users:
if active_users >= conf.max_users and not conf.max_users:
# same message as in users.js
webnotes.msgprint("""Alas! <br />\
You already have <b>%(active_users)s</b> active users, \