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:
ac6f612
)
[#2872] Ne pas planter lorsqu'une implantation n'a pas de valeur du point
author
Eric Mc Sween
<eric.mcsween@auf.org>
Tue, 3 Apr 2012 17:00:45 +0000
(13:00 -0400)
committer
Eric Mc Sween
<eric.mcsween@auf.org>
Tue, 3 Apr 2012 17:00:45 +0000
(13:00 -0400)
Dans ce cas, on prend la devise 'EUR' par défaut
project/rh/models.py
patch
|
blob
|
blame
|
history
diff --git
a/project/rh/models.py
b/project/rh/models.py
index
520f30d
..
b621fa4
100644
(file)
--- a/
project/rh/models.py
+++ b/
project/rh/models.py
@@
-248,7
+248,11
@@
class Poste_(AUFMetadata):
return [self.implantation.region]
def get_devise(self):
- return ValeurPoint.objects.filter(implantation=self.implantation, devise__archive=False).order_by('annee')[0].devise
+ vp = ValeurPoint.objects.filter(implantation=self.implantation, devise__archive=False).order_by('annee')
+ if len(vp) > 0:
+ return vp[0].devise
+ else:
+ return Devise.objects.get(code='EUR')
class Poste(Poste_):
__doc__ = Poste_.__doc__