Browse Source

Merge pull request #1878 from vjFaLk/email-group-limit

Added email group to limit commands
version-14
Anand Doshi 9 years ago
committed by GitHub
parent
commit
b5a704ddcf
2 changed files with 6 additions and 6 deletions
  1. +5
    -5
      frappe/commands/site.py
  2. +1
    -1
      frappe/email/doctype/email_group/email_group.py

+ 5
- 5
frappe/commands/site.py View File

@@ -376,8 +376,8 @@ def _set_limits(context, site, limits):
with frappe.init_site(site): with frappe.init_site(site):
new_limits = {} new_limits = {}
for limit, value in limits: for limit, value in limits:
if limit not in ('emails', 'space', 'users', 'expiry',
'support_email', 'support_chat', 'upgrade_url'):
if limit not in ('emails', 'space', 'users', 'email_group',
'expiry', 'support_email', 'support_chat', 'upgrade_url'):
frappe.throw('Invalid limit {0}'.format(limit)) frappe.throw('Invalid limit {0}'.format(limit))


if limit=='expiry': if limit=='expiry':
@@ -389,7 +389,7 @@ def _set_limits(context, site, limits):
elif limit=='space': elif limit=='space':
value = float(value) value = float(value)


elif limit in ('users', 'emails'):
elif limit in ('users', 'emails', 'email_group'):
value = int(value) value = int(value)


new_limits[limit] = value new_limits[limit] = value
@@ -398,8 +398,8 @@ def _set_limits(context, site, limits):


@click.command('clear-limits') @click.command('clear-limits')
@click.option('--site', help='site name') @click.option('--site', help='site name')
@click.argument('limits', nargs=-1, type=click.Choice(['emails', 'space', 'users', 'expiry',
'support_email', 'support_chat', 'upgrade_url']))
@click.argument('limits', nargs=-1, type=click.Choice(['emails', 'space', 'users', 'email_group',
'expiry', 'support_email', 'support_chat', 'upgrade_url']))
@pass_context @pass_context
def clear_limits(context, site, limits): def clear_limits(context, site, limits):
"""Clears given limit from the site config, and removes limit from site config if its empty""" """Clears given limit from the site config, and removes limit from site config if its empty"""


+ 1
- 1
frappe/email/doctype/email_group/email_group.py View File

@@ -93,7 +93,7 @@ def add_subscribers(name, email_list):
def restrict_email_group(doc, method): def restrict_email_group(doc, method):
from frappe.limits import get_limits from frappe.limits import get_limits


email_group_limit = get_limits().get('email_group_limit')
email_group_limit = get_limits().get('email_group')
if not email_group_limit: if not email_group_limit:
return return




Loading…
Cancel
Save