Beispiel #1
0
 def bump_waitlist_for_x_users(self, extra_capacity=1):
     """Handle bumping of the x first users on the waitlist"""
     from apps.events.utils import handle_waitlist_bump  # Imported here to avoid circular import
     if not self.waitlist_qs:
         return
     bumped_attendees = self.waitlist_qs[:extra_capacity]
     handle_waitlist_bump(self.event, bumped_attendees, self.payment())
Beispiel #2
0
    def notify_waiting_list(self, host, unattended_user=None, extra_capacity=1):
        from apps.events.utils import handle_waitlist_bump  # Imported here to avoid circular import
        # Notify next user on waiting list
        wait_list = self.waitlist_qs
        if wait_list:
            # Checking if user is on the wait list
            on_wait_list = False
            if unattended_user:
                for waiting_user in wait_list:
                    if waiting_user.user == unattended_user:
                        on_wait_list = True
                        break
            if not on_wait_list:
                # Send mail to first user on waiting list
                attendees = wait_list[:extra_capacity]

                handle_waitlist_bump(self.event, host, attendees, self.payment())