Show the current training skill on the character view

This commit is contained in:
2011-03-16 16:06:22 +00:00
parent d9a65553dd
commit c4ca21eb9a
2 changed files with 7 additions and 1 deletions

View File

@@ -97,7 +97,10 @@ def eveapi_character(request, charid=None):
if charid:
character = get_object_or_404(EVEPlayerCharacter.objects.select_related('corporation', 'corporation__aliance'), id=charid)
current_training = character.eveplayercharacterskill_set.filter(in_training__gt=0)
try:
current_training = character.eveplayercharacterskill_set.get(in_training__gt=0)
except:
current_training = None
skills = character.eveplayercharacterskill_set.all().order_by('skill__group__name', 'skill__name')
return render_to_response('eve_api/character.html', locals(), context_instance=RequestContext(request))