From 4b2b159d12f38f6bb2a9bea22aa2e2482adbaba0 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 30 Apr 2012 20:00:19 +0530 Subject: [PATCH] if max_users = 0, consider unlimited users --- erpnext/utilities/page/users/users.js | 2 +- erpnext/utilities/page/users/users.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/utilities/page/users/users.js b/erpnext/utilities/page/users/users.js index 704682eafc..28fbc1b0f4 100644 --- a/erpnext/utilities/page/users/users.js +++ b/erpnext/utilities/page/users/users.js @@ -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!
\ You already have %(active_users)s active users, \ which is the maximum number that you are currently allowed to add.

\ diff --git a/erpnext/utilities/page/users/users.py b/erpnext/utilities/page/users/users.py index 819f7bb1da..2b7c884821 100644 --- a/erpnext/utilities/page/users/users.py +++ b/erpnext/utilities/page/users/users.py @@ -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!
\ You already have %(active_users)s active users, \