Skip to content

Commit

Permalink
SA 1: Hostel Management (#1348)
Browse files Browse the repository at this point in the history
* GAD-5: Fix responsiveness (#1125)

Co-authored-by: A Anunaya <[email protected]>
Co-authored-by: Aksh Bansal <[email protected]>

* setup

* chore:alloted_rooms and all_staff are added

* doing

* chor:HostelAllotment

* comment in import hostelstudentattendance in views

* Chore:change in staff schedule

* chore:Hostelleave- caretaker and wardern can see all leave forms

* chore:post request delete from StaffScheduleView class

* chore:Hostelleave- student can apply for hostel leave

* adding functionality of super admin

* chore:all_stuff changed

* functionality assigned batch

* Chore:CURD API in hostel_management_hostelinventory

* added functionality of assigning caretaker

* chore:hostel_complaint_implemented

* chore:inventory_form change

* added frontend of alloted_room and linked with backend

* chore: hostel_complaint and hostel_leave implemented

* feat:hall_inventory form submmit,edit,delete

* Merging migration of database

* added assign-warden , add-hostel ,delete-hostel in frontend and backend

* akshay PR merge

* chore:hall id set

* Final merge of akshay,ankit,anuj

* uncommented functionality of hostel_complaint_list/

* fix:hall select problem fixed

* fix:dropdownlist change when hall.id change in URL

* Added frontend of all_leave_data,alloted_rooms_main,create_leave,complaint_form

* chore: login required

* chore: login required implemented

* feat:authentication added

* feat: authentication added in hostel leave and hostel complaint system and also added all operations that  caretaker and warden can perform

* Added frontend with templates of all_leave_data,alloted_rooms_main,create_leave,complaint_form

* book guestroom

* chore: run python manage.py copy_data to merge table to get all student details at one place

* chore: Added functionality - caretaker and warden can get all details of student of their hall -----used StudentDetails table

* guest room part done

* added templates for hostel_complaint,inventory_form,my_leaves

* added full student details table

* Added api endpoints for notifications

* fix:input fields of complaint and leave form

* added funtionality of hostel super admin , guest room

* feat:caretaker manage fine impose

* migration files of DB

* resolved error in sending notification for announcements

* chore:student fine show

* fix:student details

* updated html files with template

* updated alerts.html and alert1.html for implementing delete notification

* chore:fine frontend design

* fix:List name change

* updated frontend using templates

* fixed few bugs and few glitches.

* Added pylint  (#1302)

* Create bandit_security_test.yml

Added Bandit security test for python

* Update bandit_security_test.yml

* Update bandit_security_test.yml

* Create pylint.yml

* Update pylint.yml

* Update pylint.yml

* Revert "Added pylint  (#1302)" (#1324)

This reverts commit c1359b7.

* GAD -5 Dashboard Changes (#1325)

* dashboard and usercard updated (#1329)

* minor changes

* removed HostelAllotment class

* chore:Student fine show

* chore:date disable feature added

* fix:notification message for room booking request is changed

* added dropdown in sidebar

* changes in programme_cuuriculam,adding version to models (#1330)

* added hostelTransactions

* Seater type added and vacant seats added

* added seater,vacant,logs

* fix: calender,fine

* only vacant room show in guestroom

* added Hostel history functionality

* fix:UI of tables

* fix:UI of tables

* migration

* added remark field in leave

* fix:hostelTransaction

* fix

* fix:In leave request remark option is added

* added notification functionality

* added remark column in leave request

* migrations files

* Fixing ui bugs (#1335)

* Synced with new Dashboard

Some changes made to dashboard module in terms of UI and context updated.

* .DS_Store

* commented inventory

* updated gitignore

* updated gitignore

* removed migrations

---------

Co-authored-by: Harshvardhan Singh <[email protected]>
Co-authored-by: A Anunaya <[email protected]>
Co-authored-by: Aksh Bansal <[email protected]>
Co-authored-by: akshatnema <[email protected]>
Co-authored-by: Aniruddha <[email protected]>
Co-authored-by: Stark <[email protected]>
Co-authored-by: ANKIT <[email protected]>
Co-authored-by: KK <[email protected]>
Co-authored-by: Hardik Sharma <[email protected]>
Co-authored-by: Raman Chaudhary <[email protected]>
Co-authored-by: BlackHAWK2001 <[email protected]>
Co-authored-by: Arpit Tak <[email protected]>
Co-authored-by: Anudeep Sanapala <[email protected]>
Co-authored-by: Aniruddha Das <[email protected]>
Co-authored-by: SukulSarve <[email protected]>
  • Loading branch information
16 people authored Apr 10, 2024
1 parent bb8cb09 commit 0a8c0dd
Show file tree
Hide file tree
Showing 164 changed files with 5,258 additions and 5,642 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ node_modules/

FusionIIIT/static/
package-lock.json

**/**/migrations/*
Binary file added FusionIIIT/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions FusionIIIT/Fusion/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def global_vars(request):
return {
'global_var': request.session.get('currentDesignationSelected', 'default_value'),
'global_var2': request.session.get('allDesignations', 'default_value2'),
}
48 changes: 48 additions & 0 deletions FusionIIIT/Fusion/middleware/custom_middleware.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# custom_middleware.py
from django.contrib.auth.signals import user_logged_in
from django.dispatch import receiver
from applications.globals.models import (ExtraInfo, Feedback, HoldsDesignation,
Issue, IssueImage, DepartmentInfo)
from django.shortcuts import get_object_or_404, redirect, render

def user_logged_in_middleware(get_response):
@receiver(user_logged_in)
def user_logged_in_handler(sender, user, request, **kwargs):
if 'function_executed' not in request.session:
# Run the function only if the flag is not set
# Assuming user is a model with the desired data field, retrieve the data
# For example, if your User model has a field named 'custom_field', you can access it like:
if user.is_authenticated:
desig = list(HoldsDesignation.objects.select_related('user','working','designation').all().filter(working = request.user).values_list('designation'))
print(desig)
b = [i for sub in desig for i in sub]
design = HoldsDesignation.objects.select_related('user','designation').filter(working=request.user)

designation=[]

designation.append(str(user.extrainfo.user_type))
for i in design:
if str(i.designation) != str(user.extrainfo.user_type):
print('-------')
print(i.designation)
print(user.extrainfo.user_type)
print('')
designation.append(str(i.designation))

for i in designation:
print(i)

request.session['currentDesignationSelected'] = designation[0]
request.session['allDesignations'] = designation
print("logged iN")

# Set the flag in the session to indicate that the function has bee+n executed
request.session['function_executed'] = True

def middleware(request):
if request.user.is_authenticated:
user_logged_in_handler(request.user, request.user, request)
response = get_response(request)
return response

return middleware
2 changes: 2 additions & 0 deletions FusionIIIT/Fusion/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'Fusion.middleware.custom_middleware.user_logged_in_middleware',
]

ROOT_URLCONF = 'Fusion.urls'
Expand All @@ -178,6 +179,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'Fusion.context_processors.global_vars',
],
},
},
Expand Down
Binary file added FusionIIIT/applications/.DS_Store
Binary file not shown.
Binary file not shown.

This file was deleted.

Loading

0 comments on commit 0a8c0dd

Please sign in to comment.