[#3303] org employé all employé pour rég
authorDavin Baragiotta <davin.baragiotta@auf.org>
Fri, 8 Jun 2012 12:23:32 +0000 (08:23 -0400)
committerDavin BARAGIOTTA <davin.baragiotta@auf.org>
Fri, 8 Jun 2012 12:23:32 +0000 (08:23 -0400)
project/rh/admin.py

index d2c57a1..659c353 100644 (file)
@@ -637,6 +637,15 @@ class EmployeProxyAdmin(EmployeAdmin):
         super(EmployeProxyAdmin, self).__init__(*args, **kwargs)
         self.list_display_links = (None, )
 
+    def queryset(self, request):
+        qs = super(ProtectRegionMixin, self).queryset(request)
+
+        if in_drh_or_admin(request.user) or \
+            user_gere_obj_de_sa_region(request.user):
+            return qs
+
+        return qs.none()
+
     def has_add_permission(self, obj):
         return False