from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import render

from perfiles_usuario.utils import is_capturista
from estudios_socioeconomicos.models import Estudio


@login_required
@user_passes_test(is_capturista)
def capturista_dashboard(request):
    """View to render the capturista control dashboard.

       This view shows the list of socio-economic studies that are under review
       and the button to add a new socio-economic study.
       Also shows the edit and see feedback buttons to each socio-economic study
       shown in the list if this exists for the current user (capturist).
    """
    estudios = []
    iduser = request.user.id
    rechazados = Estudio.objects.filter(status='rechazado')
    for estudio in rechazados:
        if estudio.capturista_id == iduser:
            estudios.append(estudio)
    return render(request, 'captura/dashboard_capturista.html',
                  {'estudios': estudios})

@@ -225,16 +225,17 @@
 equired%0A
+#
 @user_pa
@@ -659,32 +659,15 @@
     
-estudios = %5B%5D%0A    id
 user
+_id
  = r
@@ -685,24 +685,22 @@
 .id%0A    
-rechazad
+estudi
 os = Est
@@ -730,131 +730,48 @@
 tus=
-'rechazado')%0A    for estudio in rechazados:%0A        if estudio.capturista_id == iduser:%0A            estudios.append(estudio
+Estudio.RECHAZADO, capturista_id=user_id
 )%0A  

Correct the view of capturist dashboard