示例#1
0
    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))
示例#2
0
    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))
示例#3
0
    def become_leader(self):
        if self.is_leader:
            return

        self.is_leader = True
        self.leader = None
        self.save()
        
        if self.allow_official:
            subscribe_list(self.chapter.get_official_list(), self.get_email(proxy=False))
示例#4
0
    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))
示例#5
0
    def activate(self, chapter, leader, commit=True):
        # make user an active member of the chapter
        self.status = UserProfile.APPROVED
        self.chapter = chapter
        if leader.get_profile().available_to_lead():
            self.assign_leader(leader, commit=commit)
        else:
            self.assign_leader(None, commit=commit)

        proxy_email(self.get_email(proxy=False), self.user.username, relative=True, unproxy=True)
        
        if self.allow_announce:
            subscribe_list(self.chapter.get_announce_list(), self.get_email(proxy=False))
        
        if self.allow_discuss:
            subscribe_list(self.chapter.get_discuss_list(), self.get_email(proxy=False))