Commits

Marcin Kuzminski committed c0d8171

implements #291 email notification sent to all admin users

  • Participants
  • Parent commits cd1c21a
  • Branches default

Comments (0)

Files changed (1)

rhodecode/lib/celerylib/tasks.py

 
 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
 
     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')