Open jmzaleski opened 7 years ago
I repeated the above recipe (except templates z1,z2) using postman, so I could see what the server thought at each point. looks pretty clear that the save of template z2 ruins the allocations of template z1
{
"id": 5,
"name": "z1",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:42:28.854-04:00",
"updated_at": "2017-09-29T11:42:28.854-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [
{
"id": 3,
"num_unit": 42,
"unit_name": "created in z1",
"minutes": 60,
"duty_id": 5,
"created_at": "2017-09-29T11:43:05.266-04:00",
"updated_at": "2017-09-29T11:43:05.266-04:00"
}
],
"trainings": [],
"categories": []
}
{
"id": 5,
"name": "z1",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:42:28.854-04:00",
"updated_at": "2017-09-29T11:42:28.854-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [
{
"id": 3,
"num_unit": 42,
"unit_name": "created in z1",
"minutes": 60,
"duty_id": 5,
"created_at": "2017-09-29T11:43:05.266-04:00",
"updated_at": "2017-09-29T11:43:05.266-04:00"
}
],
"trainings": [],
"categories": []
},
{
"id": 6,
"name": "z2",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:44:29.179-04:00",
"updated_at": "2017-09-29T11:44:29.179-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [],
"trainings": [],
"categories": []
}
{
"id": 5,
"name": "z1",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:42:28.854-04:00",
"updated_at": "2017-09-29T11:42:28.854-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [
{
"id": 3,
"num_unit": 42,
"unit_name": "created in z1",
"minutes": 60,
"duty_id": 5,
"created_at": "2017-09-29T11:43:05.266-04:00",
"updated_at": "2017-09-29T11:43:05.266-04:00"
}
],
"trainings": [],
"categories": []
},
{
"id": 6,
"name": "z2",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:44:29.179-04:00",
"updated_at": "2017-09-29T11:44:29.179-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [],
"trainings": [],
"categories": []
}
{
"id": 5,
"name": "z1",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:42:28.854-04:00",
"updated_at": "2017-09-29T11:42:28.854-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [],
"trainings": [],
"categories": []
},
{
"id": 6,
"name": "z2",
"optional": true,
"instructor_id": 2,
"tutorial_category": "Classroom TA",
"department": "Computer Science",
"created_at": "2017-09-29T11:44:29.179-04:00",
"updated_at": "2017-09-29T11:44:29.179-04:00",
"scaling_learning": false,
"supervisor": "Mathew Zaleski",
"allocations": [
{
"id": 3,
"num_unit": 42,
"unit_name": "created in z1",
"minutes": 60,
"duty_id": 5,
"created_at": "2017-09-29T11:43:05.266-04:00",
"updated_at": "2017-09-29T11:47:44.079-04:00"
}
],
"trainings": [],
"categories": []
}
This is a really weird one. No sense of whether it's front end or back end.. Basic issue is that when I apply a template for the second time the TA the template was applied to PREVIOUSLY seems to be set back to some empty default condition.
Okay, it's weird, so here's a detailed recipe for the simplest case I could find, namely applying one template to another. BTW, as will become clear below, only happens when you save the second template.
At time of writing HEAD of master was https://github.com/uoft-tapp/tapp-cp/commit/d24fed264dfb5e8d1ecf8418b00b660e522ad326
I started with a clean image. down -v all around.
If you do not save t2 after applying t1, but instead cancel out then t1 survives. IT IS THE SAVE