Support infinite number of aliases and emails

master
Pierre Jaury 9 years ago
parent 949df33831
commit 370a2fae4d

@ -16,7 +16,7 @@ def alias_list(domain_name):
@flask_login.login_required
def alias_create(domain_name):
domain = utils.get_domain_admin(domain_name)
if len(domain.aliases) >= domain.max_aliases:
if domain.max_aliases and len(domain.aliases) >= domain.max_aliases:
flask.flash('Too many aliases for domain %s' % domain, 'error')
return flask.redirect(flask.url_for('alias_list', domain_name=domain.name))
form = forms.AliasCreateForm()

@ -16,7 +16,7 @@ def user_list(domain_name):
@flask_login.login_required
def user_create(domain_name):
domain = utils.get_domain_admin(domain_name)
if len(domain.users) >= domain.max_users:
if domain.mex_users and len(domain.users) >= domain.max_users:
flask.flash('Too many users for domain %s' % domain, 'error')
return flask.redirect(flask.url_for('user_list', domain_name=domain.name))
form = forms.UserCreateForm()

Loading…
Cancel
Save