Add check for deleted session when scheduling. Fixes . Commit ready for merge

- Legacy-Id: 14842
This commit is contained in:
Ryan Cross 2018-03-17 15:10:20 +00:00
parent 49f00b76ea
commit 7211cf399b
2 changed files with 12 additions and 0 deletions
ietf
meeting
static/ietf/js/agenda

View file

@ -455,6 +455,13 @@ def assignments_post(request, meeting, schedule):
status = 406,
content_type="application/json")
try:
Session.objects.get(pk=newvalues["session_id"])
except Session.DoesNotExist:
return HttpResponse(json.dumps({'error':'session has been deleted'}),
status = 406,
content_type="application/json")
ss1 = SchedTimeSessAssignment(schedule = schedule,
session_id = newvalues["session_id"],
timeslot_id = newvalues["timeslot_id"])

View file

@ -482,6 +482,11 @@ ScheduledSlot.prototype.saveit = function() {
session.placed(myss.timeslot);
}
});
saveit.fail(function(jqXHR, textStatus) {
var xhr = JSON.parse(jqXHR.responseText);
alert("ERROR: " + xhr.error + "\nThe schedule will now reload.");
location.reload(true);
});
// return the promise, in case someone (tests!) needs to know when we are done.
return saveit;