Merged in [14842] from rcross@amsl.com:
Add check for deleted session when scheduling. Fixes #2450.
- Legacy-Id: 14847
Note: SVN reference [14842] has been migrated to Git commit 7211cf399b
This commit is contained in:
commit
e0ca40bdf2
|
@ -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"])
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue