Skip to content

Commit dbc1762

Browse files
committed
Added a break_info() model on Timeslot. Fixes the missing breaks on the
text agenda. - Legacy-Id: 6376
1 parent f95b279 commit dbc1762

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

ietf/meeting/models.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytz, datetime
44
from urlparse import urljoin
55
import copy
6+
import debug
67

78
from django.db import models
89
from django.conf import settings
@@ -267,6 +268,13 @@ def registration(self):
267268
def reg_info(self):
268269
return (self.registration() is not None)
269270

271+
def break_info(self):
272+
breaks = self.__class__.objects.filter(meeting=self.meeting, time__month=self.time.month, time__day=self.time.day, type="break").order_by("time")
273+
for brk in breaks:
274+
if brk.time_desc[-4:] == self.time_desc[:4]:
275+
return brk
276+
return None
277+
270278
def __unicode__(self):
271279
location = self.get_location()
272280
if not location:
@@ -642,14 +650,13 @@ def area(self):
642650
return ""
643651
return self.session.group.parent.acronym
644652

645-
@property
646-
def break_info(self):
647-
breaks = self.schedule.scheduledsessions_set.filter(timeslot__time__month=self.timeslot.time.month, timeslot__time__day=self.timeslot.time.day, timeslot__type="break").order_by("timeslot__time")
648-
now = self.timeslot.time_desc[:4]
649-
for brk in breaks:
650-
if brk.time_desc[-4:] == now:
651-
return brk
652-
return None
653+
# def break_info(self):
654+
# breaks = self.schedule.scheduledsessions_set.filter(timeslot__time__month=self.timeslot.time.month, timeslot__time__day=self.timeslot.time.day, timeslot__type="break").order_by("timeslot__time")
655+
# now = self.timeslot.time_desc[:4]
656+
# for brk in breaks:
657+
# if brk.time_desc[-4:] == now:
658+
# return brk
659+
# return None
653660

654661
@property
655662
def area_name(self):

0 commit comments

Comments
 (0)