def _clone_person_links(self, person_links): attrs = get_simple_column_attrs(SessionBlockPersonLink) for old_link in person_links: link = SessionBlockPersonLink() link.populate_from_attrs(old_link, attrs) link.person = self._person_map[old_link.person] yield link
def _clone_person_links(self, person_links): attrs = get_simple_column_attrs(SessionBlockPersonLink) for old_link in person_links: link = SessionBlockPersonLink() link.populate_from_attrs(old_link, attrs) link.person = self._person_map[old_link.person] yield link
def _clone_person_links(self, person_links, event_exists=False): attrs = get_simple_column_attrs(SessionBlockPersonLink) for old_link in person_links: link = SessionBlockPersonLink() link.populate_from_attrs(old_link, attrs) current_person = self._person_map[old_link.person] if event_exists and current_person.user_id in self._new_event_persons: link.person = self._new_event_persons[current_person.user_id] else: link.person = current_person yield link
def _migrate_session_block_person_links(self, old_entry): person_link_map = {} person_link_data_map = defaultdict(list) for convener in getattr(old_entry, '_conveners', []): person = self._get_person(convener) if not person: continue person_link_data = self._get_person_data(convener) person_link_data_map[person].append(person_link_data) link = person_link_map.get(person) if link: self._update_link_data(link, person_link_data_map[person]) self.print_warning('%[yellow!]Duplicated session block convener "{}"'.format(person.full_name)) else: link = SessionBlockPersonLink(person=person, **person_link_data) person_link_map[person] = link yield link