From f15993958f1cc335b942a0495f9115034b5335d2 Mon Sep 17 00:00:00 2001
From: Andrew Williams
Date: Wed, 24 Mar 2010 11:37:11 +0000
Subject: [PATCH] api_status_description now provides english description of
API key status
---
eve_api/models/api_player.py | 6 ++++++
templates/sso/profile.html | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/eve_api/models/api_player.py b/eve_api/models/api_player.py
index b39d019..4572b9d 100644
--- a/eve_api/models/api_player.py
+++ b/eve_api/models/api_player.py
@@ -39,6 +39,12 @@ class EVEAccount(EVEAPIModel):
verbose_name="API Status",
help_text="End result of the last attempt at updating this object from the API.")
+ @property
+ def api_status_description(self):
+ for choice in API_STATUS_CHOICES:
+ if choice[0] == self.api_status:
+ return choice[1]
+
def in_corp(self, corpid):
for char in self.characters.all():
if char.corporation_id == corpid:
diff --git a/templates/sso/profile.html b/templates/sso/profile.html
index 6af6301..fcb5177 100644
--- a/templates/sso/profile.html
+++ b/templates/sso/profile.html
@@ -63,7 +63,7 @@ setup.
| {{ acc.api_user_id }} |
{{ acc.api_key }} |
{{ acc.description }} |
- {{ acc.api_status }} |
+ {{ acc.api_status_description }} |
Delete |