Skip to content

Commit

Permalink
Advising IESG Secretary of personnel changes in WGs. Fixing issue #1357
Browse files Browse the repository at this point in the history
…. Commit ready for merge.

 - Legacy-Id: 8623
  • Loading branch information
sureshkrishnan committed Nov 9, 2014
1 parent 16c5e24 commit b6ff986
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ietf/group/edit.py
Expand Up @@ -21,7 +21,7 @@
from ietf.ietfauth.utils import has_role
from ietf.person.fields import AutocompletedEmailsField
from ietf.person.models import Person, Email
from ietf.group.mails import email_iesg_secretary_re_charter
from ietf.group.mails import email_iesg_secretary_re_charter, email_iesg_secretary_personnel_change

MAX_GROUP_DELEGATES = 3

Expand Down Expand Up @@ -244,6 +244,7 @@ def diff(attr, name):
diff('list_subscribe', "Mailing list subscribe address")
diff('list_archive', "Mailing list archive")

personnel_change_text=""
# update roles
for attr, slug, title in [('chairs', 'chair', "Chairs"), ('secretaries', 'secr', "Secretaries"), ('techadv', 'techadv', "Tech Advisors"), ('delegates', 'delegate', "Delegates")]:
new = clean[attr]
Expand All @@ -255,6 +256,18 @@ def diff(attr, name):
group.role_set.filter(name=slug).delete()
for e in new:
Role.objects.get_or_create(name_id=slug, email=e, group=group, person=e.person)
added = set(new) - set(old)
deleted = set(old) - set(new)
if added:
change_text=title + ' added: ' + ", ".join(x.formatted_email() for x in added)
personnel_change_text+=change_text+"\n"
if deleted:
change_text=title + ' deleted: ' + ", ".join(x.formatted_email() for x in deleted)
personnel_change_text+=change_text+"\n"

if personnel_change_text!="":
print personnel_change_text
email_iesg_secretary_personnel_change(request, group, personnel_change_text)

# update urls
new_urls = clean['urls']
Expand Down
5 changes: 5 additions & 0 deletions ietf/group/mails.py
Expand Up @@ -27,6 +27,11 @@ def email_iesg_secretary_re_charter(request, group, subject, text):
)
)

def email_iesg_secretary_personnel_change(request, group, text):
to = ["iesg-secretary@ietf.org"]
full_subject = u"Personnel change for %s working group" % (group.acronym)
send_mail_text(request, to, None, full_subject,text)

def email_milestones_changed(request, group, changes):
def wrap_up_email(to, text):
text = wrap(strip_tags(text), 70)
Expand Down

0 comments on commit b6ff986

Please sign in to comment.