]> git.parisson.com Git - teleforma.git/commitdiff
no payments for profs
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 18 May 2026 07:57:10 +0000 (09:57 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 18 May 2026 07:57:10 +0000 (09:57 +0200)
teleforma/views/crfpa.py

index 02a3ecdccdde64e93106d5bb80930d4c3992d762..0bb287dba1d958f0d75b08e639495f91579fe4d2 100644 (file)
@@ -1200,10 +1200,11 @@ class CRFPAProfileView(ProfileView):
                     profile = user.get_profile()
                 except:
                     profile = None
-                student = user.student.get()
-                payment = student.payments.order_by('-id').all()
-                if payment:
-                    payment = payment[0]
+                if not request.user.professor.all():
+                    student = user.student.get()
+                    payment = student.payments.order_by('-id').all()
+                    if payment:
+                        payment = payment[0]
         else:
             raise Http404("No access")