Skip to content

Commit 47b12de

Browse files
authored
Merge pull request #1478 from anujpatel03/sa-1-main
SA-1 Hostel Management (Fixed bug)
2 parents 2e6f006 + 43900a5 commit 47b12de

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

FusionIIIT/applications/hostel_management/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,8 @@ def post(self, request, *args, **kwargs):
11201120
hall_id = data.get('hall_id')
11211121

11221122
hall = Hall.objects.get(hall_id=hall_id)
1123-
previous_batch = hall.assigned_batch # Get the previous batch
1123+
# previous_batch = hall.assigned_batch # Get the previous batch
1124+
previous_batch = hall.assigned_batch if hall.assigned_batch is not None else 0 # Get the previous batch
11241125
hall.assigned_batch = data.get('batch')
11251126
hall.save()
11261127

FusionIIIT/templates/hostelmanagement/assign_batch.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2 class="text-center" align="center">Assign Batch</h2>
2626
var hall_id = document.getElementById('hall__id').value;
2727
var batch = document.getElementById('batch').value;
2828
// Perform AJAX request to assign batch
29-
fetch('http://0.0.0.0:8000/hostelmanagement/assign-batch/', {
29+
fetch('/hostelmanagement/assign-batch/', {
3030
method: 'POST',
3131
headers: {
3232
'Content-Type': 'application/json',

FusionIIIT/templates/hostelmanagement/assign_caretaker.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ <h2 class="text-center" align="center">Assign Caretaker</h2>
3838

3939
var hall_id = document.getElementById('_hall__id').value;
4040
var caretaker_username = document.getElementById('caretaker_username').value;
41-
console.log('~~~~~~~~~~~', hall_id);
41+
// console.log('~~~~~~~~~~~', hall_id);
4242

4343
// Perform AJAX request to assign caretaker
44-
fetch('http://0.0.0.0:8000/hostelmanagement/assign-caretaker', {
44+
fetch('/hostelmanagement/assign-caretaker', {
4545
method: 'POST',
4646
headers: {
4747
'Content-Type': 'application/json',

FusionIIIT/templates/hostelmanagement/assign_warden.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h2 class="text-center" align="center">Assign Warden</h2>
3939

4040

4141
// Perform AJAX request to assign batch
42-
fetch('http://0.0.0.0:8000/hostelmanagement/assign-warden', {
42+
fetch('/hostelmanagement/assign-warden', {
4343
method: 'POST',
4444
headers: {
4545
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)