def manage_announce(self, allow): self.allow_announce = allow self.save() if allow: subscribe_list(self.chapter.get_announce_list(), self.get_email(proxy=False)) else: unsubscribe_list(self.chapter.get_announce_list(), self.get_email(proxy=False))
def manage_discuss(self, allow): self.allow_discuss = allow self.save() if allow: subscribe_list(self.chapter.get_discuss_list(), self.get_email(proxy=False)) else: unsubscribe_list(self.chapter.get_discuss_list(), self.get_email(proxy=False))
def deactivate(self): unsubscribe_list(self.chapter.get_announce_list(), self.get_email(proxy=False)) unsubscribe_list(self.chapter.get_discuss_list(), self.get_email(proxy=False)) # make user an inactive, detached user self.resign_leadership(commit=False) self.leader = None self.chapter = None self.status = UserProfile.INACTIVE self.save()
def manage_official(self, allow): if not self.is_leader: return self.allow_official = allow self.save() if allow: subscribe_list(self.chapter.get_official_list(), self.get_email(proxy=False)) else: unsubscribe_list(self.chapter.get_official_list(), self.get_email(proxy=False))
def resign_leadership(self, commit=True): self.resign_moderation() if not self.is_leader: return self.is_leader = False for mentee in self.get_mentees(): mentee.leader = None mentee.save() create_pair_request(mentee.user, self.chapter, "My mentor (%s) stepped down as a leader." % self.display_name) if commit: self.save() unsubscribe_list(self.chapter.get_official_list(), self.get_email(proxy=False))