Skip to content

Commit 30a518a

Browse files
committed
Do utf-8 encoding of the fields in the JSON blob for meeting sessions. Fixes issue ietf-tools#1790
- Legacy-Id: 10099
1 parent 2486d70 commit 30a518a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

ietf/meeting/models.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,24 +1015,24 @@ def json_dict(self, host_scheme):
10151015
sess1['group'] = self.group.json_dict(host_scheme)
10161016
sess1['group_href'] = urljoin(host_scheme, self.group.json_url())
10171017
if self.group.parent is not None:
1018-
sess1['area'] = str(self.group.parent.acronym).upper()
1019-
sess1['description'] = str(self.group.name)
1018+
sess1['area'] = self.group.parent.acronym.upper()
1019+
sess1['description'] = self.group.name.encode('utf-8')
10201020
sess1['group_id'] = str(self.group.pk)
10211021
reslist = []
10221022
for r in self.resources.all():
10231023
reslist.append(r.json_dict(host_scheme))
10241024
sess1['resources'] = reslist
10251025
sess1['session_id'] = str(self.pk)
1026-
sess1['name'] = str(self.name)
1027-
sess1['title'] = str(self.short_name)
1028-
sess1['short_name'] = str(self.short_name)
1026+
sess1['name'] = self.name.encode('utf-8')
1027+
sess1['title'] = self.short_name.encode('utf-8')
1028+
sess1['short_name'] = self.short_name.encode('utf-8')
10291029
sess1['bof'] = str(self.group.is_bof())
1030-
sess1['agenda_note'] = str(self.agenda_note)
1030+
sess1['agenda_note'] = self.agenda_note.encode('utf-8')
10311031
sess1['attendees'] = str(self.attendees)
1032-
sess1['status'] = str(self.status)
1032+
sess1['status'] = self.status.name.encode('utf-8')
10331033
if self.comments is not None:
1034-
sess1['comments'] = str(self.comments)
1035-
sess1['requested_time'] = str(self.requested.strftime("%Y-%m-%d"))
1034+
sess1['comments'] = self.comments.encode('utf-8')
1035+
sess1['requested_time'] = self.requested.strftime("%Y-%m-%d")
10361036
# the related person object sometimes does not exist in the dataset.
10371037
try:
10381038
if self.requested_by is not None:

0 commit comments

Comments
 (0)