Fix the end_date value to return the correct value

This commit is contained in:
2011-09-05 09:11:03 +01:00
parent 7a00172abf
commit 23aa38507c

View File

@@ -35,7 +35,7 @@ class EVEPlayerCharacterEmploymentHistory(models.Model):
@property
def end_date(self):
if self.character.employmenthistory.filter(record_id__gt=self.record_id).count():
return self.character.employmenthistory.filter(record_id__gt=self.record_id)[0].start_date
return self.character.employmenthistory.filter(record_id__gt=self.record_id).order_by('record_id')[0].start_date
return None
def __unicode__(self):