Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ietf/meeting/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class SchedulingEventInline(admin.TabularInline):

class SessionAdmin(admin.ModelAdmin):
list_display = [
"meeting", "name", "group_acronym", "purpose", "attendees", "has_onsite_tool", "requested", "current_status"
"meeting", "name", "group_acronym", "purpose", "attendees", "has_onsite_tool", "chat_room", "requested", "current_status"
]
list_filter = ["purpose", "meeting", ]
raw_id_fields = ["meeting", "group", "materials", "joint_with_groups", "tombstone_for"]
Expand Down
2 changes: 1 addition & 1 deletion ietf/meeting/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ class Meta:
model = Session
fields = (
'purpose', 'name', 'short', 'type', 'requested_duration',
'on_agenda', 'agenda_note', 'has_onsite_tool', 'remote_instructions',
'on_agenda', 'agenda_note', 'has_onsite_tool', 'chat_room', 'remote_instructions',
'attendees', 'comments',
)
labels = {'requested_duration': 'Length'}
Expand Down
18 changes: 18 additions & 0 deletions ietf/meeting/migrations/0004_session_chat_room.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright The IETF Trust 2023, All Rights Reserved

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('meeting', '0003_populate_session_has_onsite_tool'),
]

operations = [
migrations.AddField(
model_name='session',
name='chat_room',
field=models.CharField(blank=True, help_text='Name of Zulip stream, if different from group acronym', max_length=32),
),
]
6 changes: 5 additions & 1 deletion ietf/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ class Session(models.Model):
remote_instructions = models.CharField(blank=True,max_length=1024)
on_agenda = models.BooleanField(default=True, help_text='Is this session visible on the meeting agenda?')
has_onsite_tool = models.BooleanField(default=False, help_text="Does this session use the officially supported onsite and remote tooling?")
chat_room = models.CharField(blank=True, max_length=32, help_text='Name of Zulip stream, if different from group acronym')

tombstone_for = models.ForeignKey('Session', blank=True, null=True, help_text="This session is the tombstone for a session that was rescheduled", on_delete=models.CASCADE)

Expand Down Expand Up @@ -1285,7 +1286,10 @@ def agenda_file(self):
return self._agenda_file

def chat_room_name(self):
if self.type_id=='plenary':
if self.chat_room:
return self.chat_room
# At some point, add a migration to add "plenary" chat room name to existing sessions in the database.
elif self.type_id=='plenary':
return 'plenary'
else:
return self.group_at_the_time().acronym
Expand Down
8 changes: 8 additions & 0 deletions ietf/meeting/tests_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,11 @@ def test_chat_archive_url(self):
self.assertEqual(session_with_jabber.chat_archive_url(), 'https://www.ietf.org/jabber/logs/fakeacronym?C=M;O=D')
chatlog = SessionPresentationFactory(session=session_with_jabber, document__type_id='chatlog').document
self.assertEqual(session_with_jabber.chat_archive_url(), chatlog.get_href())

def test_chat_room_name(self):
session = SessionFactory(group__acronym='xyzzy')
self.assertEqual(session.chat_room_name(), 'xyzzy')
session.type_id = 'plenary'
self.assertEqual(session.chat_room_name(), 'plenary')
session.chat_room = 'fnord'
self.assertEqual(session.chat_room_name(), 'fnord')
2 changes: 2 additions & 0 deletions ietf/meeting/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3975,6 +3975,7 @@ def test_edit_session(self):
'remote_instructions': 'Do this do that',
'attendees': '103',
'comments': 'So much to say',
'chat_room': 'xyzzy',
}
r = self.client.post(url, post_data)
self.assertNoFormPostErrors(r)
Expand All @@ -3989,6 +3990,7 @@ def test_edit_session(self):
self.assertEqual(session.remote_instructions, 'Do this do that')
self.assertEqual(session.attendees, 103)
self.assertEqual(session.comments, 'So much to say')
self.assertEqual(session.chat_room, 'xyzzy')

# Verify return to correct schedule when sched query parameter is present
other_schedule = ScheduleFactory(meeting=session.meeting)
Expand Down