forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist-role-holder-emails
More file actions
executable file
·36 lines (27 loc) · 1.08 KB
/
list-role-holder-emails
File metadata and controls
executable file
·36 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
import os, sys
import syslog
# boilerplate
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path = [ basedir ] + sys.path
os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
virtualenv_activation = os.path.join(basedir, "env", "bin", "activate_this.py")
if os.path.exists(virtualenv_activation):
execfile(virtualenv_activation, dict(__file__=virtualenv_activation))
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_USER)
import django
django.setup()
from django.utils.encoding import force_str
from ietf.group.models import Role
addresses = set()
for role in Role.objects.filter(
group__state__slug='active',
group__type__in=['ag','area','dir','iab','ietf','irtf','nomcom','rg','team','wg','rag']):
#sys.stderr.write(str(role)+'\n')
for e in role.person.email_set.all():
if e.active and not e.address.startswith('unknown-email-'):
addresses.add(e.address)
addresses = list(addresses)
addresses.sort()
for a in addresses:
print(force_str(a))