Fixed issue with date_fin causing 500 error
[auf_rh_dae.git] / project / rh / models.py
index f7c67e0..ddce0bf 100644 (file)
@@ -1860,8 +1860,10 @@ class ChangementPersonnel(models.Model):
        
         # Here, verify differences between the instance, before and
         # after the save.
+        df_has_changed = False
+
         if created:
-            if instance.before_save.date_fin != None:
+            if df != None:
                 df_has_changed = True
         else:
             df_has_changed = (df != instance.before_save.date_fin and