projets
/
auf_rh_dae.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9212117
)
Fix: plantage causé par un employé sans dossier
author
Eric Mc Sween
<eric.mcsween@auf.org>
Tue, 22 Jul 2014 20:51:15 +0000
(16:51 -0400)
committer
Eric Mc Sween
<eric.mcsween@auf.org>
Tue, 22 Jul 2014 20:51:15 +0000
(16:51 -0400)
project/rh/models.py
patch
|
blob
|
blame
|
history
diff --git
a/project/rh/models.py
b/project/rh/models.py
index
3c7a538
..
6fee112
100644
(file)
--- a/
project/rh/models.py
+++ b/
project/rh/models.py
@@
-562,7
+562,10
@@
class Employe(models.Model):
# Retourne en le premier du queryset si la date de fin est None
# Sinon, retourne le plus récent selon la date de fin.
# Retourne en le premier du queryset si la date de fin est None
# Sinon, retourne le plus récent selon la date de fin.
- first = res[0]
+ try:
+ first = res[0]
+ except IndexError:
+ return None
if first.date_fin == None:
return first
else:
if first.date_fin == None:
return first
else: