Correction des conflits
authorNilovna Bascunan-Vasquez <contact@nilovna.com>
Thu, 30 Jun 2011 20:37:02 +0000 (16:37 -0400)
committerNilovna Bascunan-Vasquez <contact@nilovna.com>
Thu, 30 Jun 2011 20:37:02 +0000 (16:37 -0400)
1  2 
project/recrutement/admin.py
project/recrutement/models.py

@@@ -223,36 -223,6 +223,37 @@@ class EvaluateurAdmin(VersionAdmin)
          (None, {'fields': ('candidats',)}),
      )
  
-     def get_form(self, request, obj=None, **kwargs):
++    '''def get_form(self, request, obj=None, **kwargs):
 +        """
 +        Affiche la liste des users, regions et candidats, seulement si le user
 +        connecté possède un Evaluateur
 +        """
 +        form = super(EvaluateurAdmin, self).get_form(request, obj, **kwargs)
 +        if form.declared_fields.has_key('user'):
 +            permission_field = form.declared_fields['user']
 +        else:
 +            permission_field = form.base_fields['user']
 +
 +        #if form.declared_fields.has_key('regions'):
 +        #    region_field = form.declared_fields['regions']
 +        #else:
 +        #    region_field = form.base_fields['regions']
 +
 +        if form.declared_fields.has_key('candidats'):
 +            candidats_field = form.declared_fields['candidats']
 +        else:
 +            candidats_field = form.base_fields['candidats']
 +
 +        try:
 +            user = Evaluateur.objects.get(user=request.user)
 +        except Evaluateur.DoesNotExist:
 +            #region_field.queryset = Region.objects.none()
 +            permission_field.queryset = Evaluateur.objects.none()
 +            candidats_field.queryset = Candidat.objects.none()
 +            return form
 +
 +        return form
++    '''
  
      def queryset(self, request):
          """ 
Simple merge