]> git.parisson.com Git - teleforma.git/commitdiff
add professors to student profile view
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 18 May 2026 07:08:52 +0000 (09:08 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 18 May 2026 07:08:52 +0000 (09:08 +0200)
teleforma/views/crfpa.py

index 8a7f2b54c17d8096fd62d1a9e2846503ea4ccb11..facb22d67baf4ee169a886e5a72e7c62ce5c1cb2 100644 (file)
@@ -1190,7 +1190,10 @@ class CRFPAProfileView(ProfileView):
         user = User.objects.get(username=username)
         payment = None
         profile = None
-        if user.username == request.user.username or request.user.is_superuser:
+        if user.username == request.user.username or
+            request.user.is_superuser or
+            request.user.professor.all():
+
             student = user.student.all()
             if student:
                 try: