-
Notifications
You must be signed in to change notification settings - Fork 696
Labels
Description
Description
See the comment in #8271.
This should be implemented by moving the code at
datatracker/ietf/liaisons/views.py
Lines 100 to 158 in b1cfa70
| def get_cc(group): | |
| '''Returns list of emails to use as CC for group. Simplified refactor of IETFHierarchy | |
| get_cc() and get_from_cc() | |
| ''' | |
| emails = [] | |
| # role based CCs | |
| if group.acronym in ('ietf','iesg'): | |
| emails.append(EMAIL_ALIASES['IESG']) | |
| emails.append(EMAIL_ALIASES['IETFCHAIR']) | |
| elif group.acronym in ('iab'): | |
| emails.append(EMAIL_ALIASES['IAB']) | |
| emails.append(EMAIL_ALIASES['IABCHAIR']) | |
| emails.append(EMAIL_ALIASES['IABEXECUTIVEDIRECTOR']) | |
| elif group.type_id == 'area': | |
| emails.append(EMAIL_ALIASES['IETFCHAIR']) | |
| ad_roles = group.role_set.filter(name='ad') | |
| emails.extend([ contact_email_from_role(r) for r in ad_roles ]) | |
| elif group.type_id == 'wg': | |
| ad_roles = group.parent.role_set.filter(name='ad') | |
| emails.extend([ contact_email_from_role(r) for r in ad_roles ]) | |
| chair_roles = group.role_set.filter(name='chair') | |
| emails.extend([ contact_email_from_role(r) for r in chair_roles ]) | |
| if group.list_email: | |
| emails.append('{} Discussion List <{}>'.format(group.name,group.list_email)) | |
| elif group.type_id == 'sdo': | |
| liaiman_roles = group.role_set.filter(name='liaiman') | |
| emails.extend([ contact_email_from_role(r) for r in liaiman_roles ]) | |
| # explicit CCs | |
| liaison_cc_roles = group.role_set.filter(name='liaison_cc_contact') | |
| emails.extend([ contact_email_from_role(r) for r in liaison_cc_roles ]) | |
| return emails | |
| def get_contacts_for_group(group): | |
| '''Returns default contacts for groups as a comma separated string''' | |
| # use explicit default contacts if defined | |
| explicit_contacts = contacts_from_roles(group.role_set.filter(name='liaison_contact')) | |
| if explicit_contacts: | |
| return explicit_contacts | |
| # otherwise construct based on group type | |
| contacts = [] | |
| if group.type_id == 'area': | |
| roles = group.role_set.filter(name='ad') | |
| contacts.append(contacts_from_roles(roles)) | |
| elif group.type_id == 'wg': | |
| roles = group.role_set.filter(name='chair') | |
| contacts.append(contacts_from_roles(roles)) | |
| elif group.acronym == 'ietf': | |
| contacts.append(EMAIL_ALIASES['IETFCHAIR']) | |
| elif group.acronym == 'iab': | |
| contacts.append(EMAIL_ALIASES['IABCHAIR']) | |
| contacts.append(EMAIL_ALIASES['IABEXECUTIVEDIRECTOR']) | |
| elif group.acronym == 'iesg': | |
| contacts.append(EMAIL_ALIASES['IESG']) | |
| return ','.join(contacts) |
Code of Conduct
- I agree to follow the IETF's Code of Conduct