-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ac 1 Request to merge in staging again. (#1373)
* Checked the sidebar after acad-admin login and fixed the (#1113) fix: icons that were disabled or not working. * Enabled all modules for access (#1120) * AC-1 : Add functionality to add and update courses (#1300) * Add functionality to add and update courses * Course version added * Delete FusionIIIT/Fusion/settings/development.py * Delete FusionIIIT/applications/academic_procedures/migrations/0002_auto_20240218_1206.py * Delete FusionIIIT/applications/eis/migrations/0002_auto_20240218_1206.py * Delete FusionIIIT/applications/globals/migrations/0002_auto_20240218_1206.py * Delete FusionIIIT/applications/globals/migrations/0003_auto_20240218_1235.py * Delete FusionIIIT/applications/globals/migrations/0004_auto_20240218_1242.py * Delete FusionIIIT/applications/globals/migrations/0005_auto_20240218_1325.py * Delete FusionIIIT/applications/globals/migrations/0006_auto_20240218_1336.py * Delete FusionIIIT/applications/globals/migrations/0007_auto_20240218_1601.py * Delete FusionIIIT/applications/globals/migrations/0008_auto_20240218_1942.py * Delete FusionIIIT/applications/globals/migrations/0009_auto_20240219_2217.py * Delete FusionIIIT/applications/globals/migrations/0010_auto_20240219_2232.py * Delete FusionIIIT/applications/scholarships/migrations/0002_auto_20240218_1206.py * Delete requirements.txt * Delete FusionIIIT/applications/programme_curriculum/migrations/0002_auto_20240312_1929.py * Delete FusionIIIT/applications/programme_curriculum/migrations/0003_auto_20240312_1944.py * Delete FusionIIIT/applications/programme_curriculum/migrations/0004_course_latest_version.py * Delete FusionIIIT/applications/programme_curriculum/migrations/0005_auto_20240313_0128.py * AC-1 Updated according to dashboard (#1355) * GAD-5: Fix responsiveness (#1125) Co-authored-by: A Anunaya <[email protected]> Co-authored-by: Aksh Bansal <[email protected]> * GAD -5 Dashboard Changes (#1325) * dashboard and usercard updated (#1329) * Fixing ui bugs (#1335) * Ac1 Updated Dashboard --------- 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: BlackHAWK2001 <[email protected]> Co-authored-by: Arpit Tak <[email protected]> Co-authored-by: SukulSarve <[email protected]> * 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. * changes in programme_cuuriculam,adding version to models (#1330) * Ac-1 updated model.py (#1372) * GAD-5: Fix responsiveness (#1125) Co-authored-by: A Anunaya <[email protected]> Co-authored-by: Aksh Bansal <[email protected]> * GAD -5 Dashboard Changes (#1325) * dashboard and usercard updated (#1329) * Fixing ui bugs (#1335) * Ac1 Updated Dashboard * changes * Changes in model.py * Changes in model.py --------- 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: BlackHAWK2001 <[email protected]> Co-authored-by: Arpit Tak <[email protected]> Co-authored-by: SukulSarve <[email protected]> --------- Co-authored-by: EyeOfHorus158 <[email protected]> Co-authored-by: Yathartha Goenka <[email protected]> Co-authored-by: akshatnema <[email protected]> Co-authored-by: Ravichendraa <[email protected]> Co-authored-by: Harshvardhan Singh <[email protected]> Co-authored-by: A Anunaya <[email protected]> Co-authored-by: Aksh Bansal <[email protected]> Co-authored-by: BlackHAWK2001 <[email protected]> Co-authored-by: Arpit Tak <[email protected]> Co-authored-by: SukulSarve <[email protected]> Co-authored-by: Hardik Sharma <[email protected]> Co-authored-by: Raman Chaudhary <[email protected]> Co-authored-by: Anudeep Sanapala <[email protected]>
- Loading branch information
1 parent
6de59f0
commit 16523a7
Showing
47 changed files
with
5,156 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.