Improved email...get_recipients().

This commit is contained in:
2018-01-23 18:38:35 +01:00
parent b1b573097d
commit 10841cb0cd
2 changed files with 45 additions and 46 deletions

16
dav_events/utils.py Normal file
View File

@@ -0,0 +1,16 @@
import logging
from django.contrib.auth.models import Group
logger = logging.getLogger(__name__)
def get_group_members(group_name, ignore_missing=False):
users = []
try:
group = Group.objects.get(name=group_name)
users.extend(group.user_set.all())
except Group.DoesNotExist:
if not ignore_missing:
raise
return users