Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion FusionIIIT/applications/hostel_management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,8 @@ def post(self, request, *args, **kwargs):
hall_id = data.get('hall_id')

hall = Hall.objects.get(hall_id=hall_id)
previous_batch = hall.assigned_batch # Get the previous batch
# previous_batch = hall.assigned_batch # Get the previous batch
previous_batch = hall.assigned_batch if hall.assigned_batch is not None else 0 # Get the previous batch
hall.assigned_batch = data.get('batch')
hall.save()

Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/templates/hostelmanagement/assign_batch.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 class="text-center" align="center">Assign Batch</h2>
var hall_id = document.getElementById('hall__id').value;
var batch = document.getElementById('batch').value;
// Perform AJAX request to assign batch
fetch('http://0.0.0.0:8000/hostelmanagement/assign-batch/', {
fetch('/hostelmanagement/assign-batch/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions FusionIIIT/templates/hostelmanagement/assign_caretaker.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ <h2 class="text-center" align="center">Assign Caretaker</h2>

var hall_id = document.getElementById('_hall__id').value;
var caretaker_username = document.getElementById('caretaker_username').value;
console.log('~~~~~~~~~~~', hall_id);
// console.log('~~~~~~~~~~~', hall_id);

// Perform AJAX request to assign caretaker
fetch('http://0.0.0.0:8000/hostelmanagement/assign-caretaker', {
fetch('/hostelmanagement/assign-caretaker', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/templates/hostelmanagement/assign_warden.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2 class="text-center" align="center">Assign Warden</h2>


// Perform AJAX request to assign batch
fetch('http://0.0.0.0:8000/hostelmanagement/assign-warden', {
fetch('/hostelmanagement/assign-warden', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down