Shows if the recommendation is valid

This commit is contained in:
2010-12-23 12:04:26 +00:00
parent b389994e23
commit 11c96a57c9
3 changed files with 17 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
from datetime import datetime
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from eve_api.models import EVEPlayerCharacter, EVEPlayerCorporation
@@ -115,6 +116,13 @@ class Recommendation(models.Model):
def get_absolute_url(self):
return ('hr.views.view_application', [self.application.id])
@property
def is_valid(self):
diff = datetime.utcnow() - self.user_character.corporation_date
if diff.days > settings.HR_RECOMMENDATION_DAYS and self.user_character == application.corporation:
return True
return False
def __unicode__(self):
return self.user_character.name