Correction erreurs region, poste pour visualisation offre d'emploi
authorNilovna Bascunan-Vasquez <contact@nilovna.com>
Tue, 16 Aug 2011 15:16:30 +0000 (11:16 -0400)
committerNilovna Bascunan-Vasquez <contact@nilovna.com>
Tue, 16 Aug 2011 15:16:30 +0000 (11:16 -0400)
project/recrutement/admin.py

index cb7f523..243f7f7 100644 (file)
@@ -69,7 +69,7 @@ class OffreEmploiAdmin(VersionAdmin):
         form = super(OffreEmploiAdmin, self).get_form(request, obj, **kwargs)
         employe = get_emp(request.user)
         user_groupes = request.user.groups.all()
-
+        
         # Region
         if form.declared_fields.has_key('region'):
             region_field = form.declared_fields['region']
@@ -107,7 +107,7 @@ class OffreEmploiAdmin(VersionAdmin):
             bureau_field.queryset = Bureau.objects.\
                                     filter(region=employe.implantation.region)   
         return form
-
+        
     ### Queryset
     def queryset(self, request):
         qs = self.model._default_manager.get_query_set()
@@ -198,6 +198,11 @@ class ProxyOffreEmploiAdmin(OffreEmploiAdmin):
         return HttpResponseRedirect(reverse\
                             ('admin:recrutement_proxyoffreemploi_changelist'))
 
+    ### Formulaire
+    def get_form(self, request, obj=None, **kwargs):
+        form = super(OffreEmploiAdmin, self).get_form(request, obj, **kwargs)
+        return form
+
     ### Permissions add, delete, change
     def has_add_permission(self, request):
         return False