Create no ScheduledSessions with session=None
- Legacy-Id: 7510
This commit is contained in:
parent
ad54cfe230
commit
0d5a940f55
|
@ -179,16 +179,16 @@ class Meeting(models.Model):
|
|||
|
||||
# this functions makes a list of timeslices and rooms, and
|
||||
# makes sure that all schedules have all of them.
|
||||
def create_all_timeslots(self):
|
||||
alltimeslots = self.timeslot_set.all()
|
||||
for sched in self.schedule_set.all():
|
||||
ts_hash = {}
|
||||
for ss in sched.scheduledsession_set.all():
|
||||
ts_hash[ss.timeslot] = ss
|
||||
for ts in alltimeslots:
|
||||
if not (ts in ts_hash):
|
||||
ScheduledSession.objects.create(schedule = sched,
|
||||
timeslot = ts)
|
||||
# def create_all_timeslots(self):
|
||||
# alltimeslots = self.timeslot_set.all()
|
||||
# for sched in self.schedule_set.all():
|
||||
# ts_hash = {}
|
||||
# for ss in sched.scheduledsession_set.all():
|
||||
# ts_hash[ss.timeslot] = ss
|
||||
# for ts in alltimeslots:
|
||||
# if not (ts in ts_hash):
|
||||
# ScheduledSession.objects.create(schedule = sched,
|
||||
# timeslot = ts)
|
||||
|
||||
def vtimezone(self):
|
||||
if self.time_zone:
|
||||
|
@ -265,7 +265,7 @@ class Room(models.Model):
|
|||
time=ts.time,
|
||||
location=self,
|
||||
duration=ts.duration)
|
||||
self.meeting.create_all_timeslots()
|
||||
#self.meeting.create_all_timeslots()
|
||||
|
||||
def domid(self):
|
||||
return "room%u" % (self.pk)
|
||||
|
@ -411,7 +411,7 @@ class TimeSlot(models.Model):
|
|||
ts.location = room
|
||||
ts.save()
|
||||
|
||||
self.meeting.create_all_timeslots()
|
||||
#self.meeting.create_all_timeslots()
|
||||
|
||||
"""
|
||||
This routine deletes all timeslots which are in the same time as this slot.
|
||||
|
|
|
@ -95,8 +95,9 @@ def build_timeslots(meeting,room=None):
|
|||
time=new_time,
|
||||
location=room,
|
||||
duration=t.duration)
|
||||
ScheduledSession.objects.create(schedule=schedule,timeslot=t)
|
||||
meeting.create_all_timeslots();
|
||||
# Is this still right? I thought we had already moved away from dangling ScheduledSessions.
|
||||
# ScheduledSession.objects.create(schedule=schedule,timeslot=t)
|
||||
#meeting.create_all_timeslots();
|
||||
|
||||
def build_nonsession(meeting):
|
||||
'''
|
||||
|
@ -127,7 +128,8 @@ def build_nonsession(meeting):
|
|||
time=new_time,
|
||||
duration=slot.duration,
|
||||
show_location=slot.show_location)
|
||||
ScheduledSession.objects.create(schedule=schedule,session=session,timeslot=ts)
|
||||
if session:
|
||||
ScheduledSession.objects.create(schedule=schedule,session=session,timeslot=ts)
|
||||
|
||||
def get_last_meeting(meeting):
|
||||
last_number = int(meeting.number) - 1
|
||||
|
@ -815,7 +817,7 @@ def times(request, meeting_id):
|
|||
time=new_time,
|
||||
location=room,
|
||||
duration=duration)
|
||||
ScheduledSession.objects.create(schedule=meeting.agenda,timeslot=ts)
|
||||
#ScheduledSession.objects.create(schedule=meeting.agenda,timeslot=ts)
|
||||
|
||||
messages.success(request, 'Timeslots created')
|
||||
return redirect('meetings_times', meeting_id=meeting_id)
|
||||
|
|
Loading…
Reference in a new issue