def addCCSection(self, old_cc, new_cc): """ handle the cc updating for an issue """ # CC is special in that it only updates this area if old_cc: curUsers = set(str(user) for user in old_cc) else: curUsers = set() if new_cc: newUsers = set(str(user) for user in new_cc) else: newUsers = set() # get removeCC = curUsers.difference(newUsers) removeList = ", ".join(removeCC) if removeCC: removeSection = EmailSection("Users removed from CC list") removeSection.content = "%s" % (removeList) self.appendSection(removeSection) # now curUsers only contains the users that need not be modified # add all newUsers not in curUser to cc list addCC = newUsers.difference(curUsers) addList = ", ".join(addCC) if addCC: addSection = EmailSection("Users added to CC list") addSection.content = "%s" % (addList) self.appendSection(addSection)
def addAssigneeSection(self, cur, new): assigneeSection = EmailSection("Assignee Change") if cur != None: assigneeSection.content = "Reassigned from %s to %s." % (cur, new) else: assigneeSection.content = new self.appendSection(assigneeSection)
def addResolveStateSection(self, state): """ """ curState = self.issue.resolved_state if curState == state: return resolveSection = EmailSection("Issue Resolve State") # FIXME use a template resolveSection.content = "Resolved from %s to %s." % (curState, state) self.appendSection(resolveSection)