Skip to content

Commit 94770e7

Browse files
Encode json result.
1 parent fa787b1 commit 94770e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

schools/views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ def new_assignment(request):
215215
education_service = EducationService(user.tenant_id, token)
216216
dueDate = post["duedate"] + "T" + post["duetime"] + "Z"
217217
dueDateUTC=datetime.strptime(dueDate,"%m/%d/%YT%H:%M %pZ").strftime("%Y-%m-%dT%H:%M:%SZ")
218-
result = education_service.add_assignment(post["classId"],post["name"],dueDateUTC)
219-
assignment = json.loads(result.content)
218+
result = education_service.add_assignment(post["classId"],post["name"],dueDateUTC)
219+
jsonContent = result.content.decode('utf8')
220+
assignment = json.loads(jsonContent)
220221
if post['status']=="assigned":
221222
education_service.publish_assignment(post["classId"],assignment["id"])
222223

0 commit comments

Comments
 (0)