#2784
[auf_rh_dae.git] / project / rh / managers.py
index 3e8626c..9d04f69 100644 (file)
@@ -1,6 +1,7 @@
 
 # -*- encoding: utf-8 -*-
 
+import datetime
 from django.db import models
 from django.db.models import Q
 from auf.django.metadata.managers import NoDeleteManager
@@ -80,7 +81,8 @@ class PosteManager(SecurityManager, NoDeleteManager):
     prefixe_implantation = "implantation__region"
 
     def actifs(self):
-        return super(PosteManager, self).get_query_set().filter(date_fin__gt=datetime.datetime.now())
+        q_actif = Q(date_fin__gt=datetime.datetime.now()) | Q(date_fin__isnull=True)
+        return super(PosteManager, self).get_query_set().filter(q_actif)
 
     def ma_region_ou_service(self, user):
         return super(PosteManager, self).ma_region_ou_service(user)
@@ -129,6 +131,10 @@ class DossierComparaisonManager(SecurityManager):
 
 
 class DeviseManager(NoDeleteManager):
+    pass
 
-    def get_query_set(self):
-        return super(DeviseManager, self).get_query_set().filter(archive=False)
+class ServiceManager(NoDeleteManager):
+    pass
+
+class TypeRemunerationManager(NoDeleteManager):
+    pass