Fix UnboundLocalError on classes_timeslot json view
Fix NameError on grade_min/max in save_priorities