From fa3cdd552968c16a01512948ffbe8f2ccda9f3ea Mon Sep 17 00:00:00 2001 From: Pratik Solanki <128511266+Pratik2026@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:29:59 +0530 Subject: [PATCH] Resolved Major bug and also added username field in auth data (#1635) * Made updated views for authentication, toggling notifications and removed dashboard view * Made a view for updating a role * migration files for changes made in extra_info model * Health Center Contribution - PR201 (#1625) * All changes of health center module * Redundancy bug fixes * Minor bug fix Patie0tn log form undefined behavior when changing radio field * Guideline Configs * Removed print statements according to guidelines --------- Co-authored-by: ChallaBharadwajReddy * fix: Resolved System Check errors (#1630) - fix: Changed one line bugs * Resolved system check errors * Changed some fields in IWD Module * Fixes creation of unwanted migration files - chore: migration files for the previous commit changes * fix: Resolved major bug and also added username field in auth data. --------- Co-authored-by: ramGopal <129493911+ramG-reddy@users.noreply.github.com> Co-authored-by: ChallaBharadwajReddy --- FusionIIIT/applications/globals/api/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FusionIIIT/applications/globals/api/views.py b/FusionIIIT/applications/globals/api/views.py index d878b4161..0aff2180d 100644 --- a/FusionIIIT/applications/globals/api/views.py +++ b/FusionIIIT/applications/globals/api/views.py @@ -75,6 +75,7 @@ def logout(request): def auth_view(request): user=request.user name = request.user.first_name +"_"+ request.user.last_name + roll_no = request.user.username extra_info = get_object_or_404(ExtraInfo, user=user) last_selected_role = extra_info.last_selected_role @@ -86,10 +87,11 @@ def auth_view(request): name_ = get_object_or_404(Designation, id = id) designation_info.append(str(name_.name)) + print(designation_info) accessible_modules = {} for designation in designation_info: - module_access = ModuleAccess.objects.filter(designation=designation).first() + module_access = ModuleAccess.objects.filter(designation__iexact=designation).first() if module_access: filtered_modules = {} @@ -103,6 +105,7 @@ def auth_view(request): resp={ 'designation_info' : designation_info, 'name': name, + 'roll_no': roll_no, 'accessible_modules': accessible_modules, 'last_selected_role': last_selected_role }