Skip to content

Commit 29366bf

Browse files
committed
Add default = 0 to requested_duration to accomodate non-requested
sessions and improve __unicode__ for interim meetings - Legacy-Id: 3924
1 parent c508d40 commit 29366bf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ietf/meeting/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ class Session(models.Model):
132132
meeting (time and location is stored in a TimeSlot) - if multiple
133133
timeslots are needed, multiple sessions will have to be created.
134134
Training sessions and similar are modeled by filling in a
135-
responsible group (e.g. Edu team) and filling in the name"""
135+
responsible group (e.g. Edu team) and filling in the name."""
136136
meeting = models.ForeignKey(Meeting)
137137
name = models.CharField(blank=True, max_length=255, help_text="Name of session, in case the session has a purpose rather than just being a group meeting")
138138
group = models.ForeignKey(Group) # The group type determines the session type. BOFs also need to be added as a group.
139139
attendees = models.IntegerField(null=True, blank=True)
140140
agenda_note = models.CharField(blank=True, max_length=255)
141141
requested = models.DateTimeField(default=datetime.datetime.now)
142142
requested_by = models.ForeignKey(Person)
143-
requested_duration = TimedeltaField()
143+
requested_duration = TimedeltaField(default=0)
144144
comments = models.TextField()
145145
status = models.ForeignKey(SessionStatusName)
146146
scheduled = models.DateTimeField(null=True, blank=True)
@@ -149,5 +149,8 @@ class Session(models.Model):
149149
materials = models.ManyToManyField(Document, blank=True)
150150

151151
def __unicode__(self):
152+
if self.meeting.type_id == "interim":
153+
return self.meeting.number
154+
152155
timeslots = self.timeslot_set.order_by('time')
153156
return u"%s: %s %s" % (self.meeting, self.group.acronym, timeslots[0].time.strftime("%H%M") if timeslots else "(unscheduled)")

0 commit comments

Comments
 (0)