Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a31bf43
refactored code
SayanChakraborty08 Mar 23, 2026
b2fb386
feat: Implement T22/T23/T24 analytics, T14/T16 audit/escalation, and …
harsh-bhadauria Apr 11, 2026
75e7097
Merge pull request #1 from harsh-bhadauria/test-OAP-V1
SayanChakraborty08 Apr 13, 2026
4e916c1
Revert "feat: Implement T22/T23/T24 analytics, T14/T16 audit/escalati…
SayanChakraborty08 Apr 19, 2026
a2bb3b2
Merge pull request #2 from SayanChakraborty08/revert-1-test-OAP-V1
SayanChakraborty08 Apr 19, 2026
27b3ff3
Implemented download bonafied feature
SayanChakraborty08 Apr 19, 2026
924e536
leave status
SayanChakraborty08 Apr 19, 2026
45878f9
Implemented all BRs and checks
SayanChakraborty08 Apr 19, 2026
6cbab06
Changes to be committed:
harsh-bhadauria Apr 19, 2026
ad6e4f1
Merge branch 'test-OAP-V1' of github.com:SayanChakraborty08/Fusion in…
harsh-bhadauria Apr 19, 2026
5ee8c20
Added assistantship claim
SayanChakraborty08 Apr 19, 2026
a6f8bb3
Merge branch 'test-OAP-V1' into test-OAP-V1
SayanChakraborty08 Apr 19, 2026
97116aa
Merge pull request #3 from harsh-bhadauria/test-OAP-V1
SayanChakraborty08 Apr 19, 2026
d1ac34d
Restore stable no-dues workflow
harsh-bhadauria Apr 19, 2026
da46281
Merge pull request #4 from harsh-bhadauria/test-OAP-V1
SayanChakraborty08 Apr 19, 2026
ac87114
Added TA assignment and Thesis assignment features with all BRs enforced
SayanChakraborty08 Apr 19, 2026
478509d
so many changes omgggg
SayanChakraborty08 Apr 20, 2026
46b87f8
helloooo
harsh-bhadauria Apr 20, 2026
920b334
Merge pull request #5 from harsh-bhadauria/test-OAP-V1
SayanChakraborty08 Apr 20, 2026
051f8b3
lots of bug fixes
harsh-bhadauria Apr 20, 2026
f167c36
Merge pull request #6 from harsh-bhadauria/test-OAP-V1
SayanChakraborty08 Apr 20, 2026
c4df844
final commit hopefully
harsh-bhadauria Apr 20, 2026
364c9a4
Merge pull request #7 from harsh-bhadauria/test-OAP-V1
SayanChakraborty08 Apr 20, 2026
2e71cf2
Merge branch 'test-OAP-V1' into o-academic-procedures-v1
SayanChakraborty08 May 8, 2026
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
32 changes: 31 additions & 1 deletion FusionIIIT/applications/globals/api/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import ast

Comment on lines +1 to +2
from django.contrib.auth import get_user_model
from applications.academic_information.models import Student
from applications.eis.api.views import profile as eis_profile
Expand All @@ -22,6 +24,7 @@
Issue, IssueImage, DepartmentInfo, ModuleAccess)
from .utils import get_and_authenticate_user
from notifications.models import Notification
import ast

User = get_user_model()

Expand Down Expand Up @@ -107,7 +110,34 @@ def auth_view(request):
@permission_classes([IsAuthenticated])
@authentication_classes([TokenAuthentication])
def notification(request):
notifications=serializers.NotificationSerializer(request.user.notifications.all(),many=True).data
user_notifications = request.user.notifications.all().order_by('-timestamp')
active_role = getattr(getattr(request.user, 'extrainfo', None), 'last_selected_role', None)
active_role = active_role.strip().lower() if isinstance(active_role, str) and active_role.strip() else None
if active_role and 'hod' in active_role:
active_role = 'hod'

filtered_notifications = []
for notification_obj in user_notifications:
data = notification_obj.data
parsed_data = {}

if isinstance(data, dict):
parsed_data = data
elif isinstance(data, str):
try:
parsed_data = ast.literal_eval(data)
except Exception:
parsed_data = {}
Comment on lines +124 to +130

recipient_role = parsed_data.get('recipient_role')
recipient_role = recipient_role.strip().lower() if isinstance(recipient_role, str) and recipient_role.strip() else None

if active_role and recipient_role and recipient_role != active_role:
continue

filtered_notifications.append(notification_obj)

notifications = serializers.NotificationSerializer(filtered_notifications, many=True).data

resp={
'notifications':notifications,
Expand Down
Loading
Loading