|
| 1 | +# Copyright The IETF Trust 2007-2019, All Rights Reserved |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | + |
1 | 4 | import datetime |
2 | 5 | import os |
3 | 6 | import time |
@@ -86,46 +89,12 @@ def build_timeslots(meeting,room=None): |
86 | 89 | location=room, |
87 | 90 | duration=t.duration) |
88 | 91 |
|
89 | | -def build_nonsession(meeting,schedule): |
90 | | - ''' |
91 | | - This function takes a meeting object and creates non-session records |
92 | | - for a new meeting, based on the last meeting |
93 | | - ''' |
94 | | - last_meeting = get_last_meeting(meeting) |
95 | | - if not last_meeting: |
96 | | - return None |
97 | | - |
98 | | - delta = meeting.date - last_meeting.date |
99 | | - system = Person.objects.get(name='(System)') |
100 | | - |
101 | | - for slot in TimeSlot.objects.filter(meeting=last_meeting,type__in=('break','reg','other','plenary','lead')): |
102 | | - new_time = slot.time + delta |
103 | | - session = Session.objects.create(meeting=meeting, |
104 | | - name=slot.name, |
105 | | - short=get_session(slot).short, |
106 | | - group=get_session(slot).group, |
107 | | - requested_by=system, |
108 | | - status_id='sched', |
109 | | - type=slot.type) |
110 | | - |
111 | | - ts = TimeSlot.objects.create(type=slot.type, |
112 | | - meeting=meeting, |
113 | | - name=slot.name, |
114 | | - time=new_time, |
115 | | - duration=slot.duration, |
116 | | - show_location=slot.show_location) |
117 | | - SchedTimeSessAssignment.objects.create(schedule=schedule,session=session,timeslot=ts) |
118 | | - |
119 | 92 | def check_nonsession(meeting,schedule): |
120 | 93 | ''' |
121 | 94 | Ensure non-session timeslots exist and have appropriate SchedTimeSessAssignment objects |
122 | 95 | for the specified schedule. |
123 | 96 | ''' |
124 | 97 | slots = TimeSlot.objects.filter(meeting=meeting,type__in=('break','reg','other','plenary','lead','offagenda')) |
125 | | - if not slots: |
126 | | - build_nonsession(meeting,schedule) |
127 | | - return None |
128 | | - |
129 | 98 | plenary = slots.filter(type='plenary').first() |
130 | 99 | if plenary: |
131 | 100 | assignments = plenary.sessionassignments.all() |
@@ -269,9 +238,6 @@ def add(request): |
269 | 238 | meeting.save() |
270 | 239 |
|
271 | 240 | populate_important_dates(meeting) |
272 | | - |
273 | | - # copy special sessions from previous meeting |
274 | | - build_nonsession(meeting,schedule) |
275 | 241 |
|
276 | 242 | # Create Physical new meeting directory and subdirectories |
277 | 243 | make_materials_directories(meeting) |
|
0 commit comments