# HG changeset patch # User Marcin Kuzminski # Date 2011-10-30 18:30:24 # Node ID c0d8171ade3682512c6d64508554b3a951ff29e4 # Parent cd1c21af123ab0a43cca2cc5f32124c72a64ce67 implements #291 email notification sent to all admin users diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -47,7 +47,7 @@ from rhodecode.lib.compat import json, O from rhodecode.model import init_model from rhodecode.model import meta -from rhodecode.model.db import RhodeCodeUi, Statistics, Repository +from rhodecode.model.db import RhodeCodeUi, Statistics, Repository, User from vcs.backends import get_repo @@ -346,7 +346,9 @@ def send_email(recipients, subject, body email_config = config if not recipients: - recipients = [email_config.get('email_to')] + # if recipients are not defined we send to email_config + all admins + admins = [u.email for u in User.query().filter(User.admin==True).all()] + recipients = [email_config.get('email_to')] + admins mail_from = email_config.get('app_email_from') user = email_config.get('smtp_username')