if max_users = 0, consider unlimited users
This commit is contained in:
parent
84777ac457
commit
4b2b159d12
@ -223,7 +223,7 @@ $.extend(wn.pages.users, {
|
|||||||
add_user: function() {
|
add_user: function() {
|
||||||
var me = wn.pages.users;
|
var me = wn.pages.users;
|
||||||
var active_users = $('.user-card:not(.disabled)');
|
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 />\
|
msgprint(repl("Alas! <br />\
|
||||||
You already have <b>%(active_users)s</b> active users, \
|
You already have <b>%(active_users)s</b> active users, \
|
||||||
which is the maximum number that you are currently allowed to add. <br /><br /> \
|
which is the maximum number that you are currently allowed to add. <br /><br /> \
|
||||||
|
@ -112,7 +112,7 @@ def add_profile(args):
|
|||||||
active_users = sql("""select count(*) from tabProfile
|
active_users = sql("""select count(*) from tabProfile
|
||||||
where ifnull(enabled, 0)=1 and docstatus<2
|
where ifnull(enabled, 0)=1 and docstatus<2
|
||||||
and name not in ('Administrator', 'Guest')""")[0][0]
|
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
|
# same message as in users.js
|
||||||
webnotes.msgprint("""Alas! <br />\
|
webnotes.msgprint("""Alas! <br />\
|
||||||
You already have <b>%(active_users)s</b> active users, \
|
You already have <b>%(active_users)s</b> active users, \
|
||||||
|
Loading…
Reference in New Issue
Block a user