mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Show if the key is active on the corp list
This commit is contained in:
@@ -70,10 +70,16 @@ class EVEPlayerCharacter(EVEAPIModel):
|
||||
|
||||
@property
|
||||
def account(self):
|
||||
if self.eveaccount_set.count():
|
||||
return self.eveaccount_set.all()[0]
|
||||
if self.eveaccount_set.filter(api_status=API_STATUS_OK).count():
|
||||
return self.eveaccount_set.filter(api_status=API_STATUS_OK)[0]
|
||||
return None
|
||||
|
||||
@property
|
||||
def active_key(self):
|
||||
if self.eveaccount_set.count():
|
||||
return self.eveaccount_set.filter(api_status=API_STATUS_OK).count() > 0
|
||||
return False
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('eveapi-character', [self.pk])
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
|
||||
{% if view_members %}
|
||||
<table>
|
||||
<tr><th>Name</th><th>Skillpoints</th><th>Join Date</th><th>Director?</th><th>Roles?</th><th>API Key?</th></tr>
|
||||
<tr><th>Name</th><th>Skillpoints</th><th>Join Date</th><th>Director?</th><th>Roles?</th><th>API Key?</th><th>Key Active?</th></tr>
|
||||
{% autopaginate members 20 %}
|
||||
{% for char in members %}
|
||||
<tr><td><a href="{% url eveapi-character char.id %}">{{ char.name }}</a></td><td>{% if char.total_sp %}{{ char.total_sp|intcomma }} SP{% endif %}</td><td>{{ char.corporation_date }}</td><td>{% if char.director %}Yes{% endif %}</td><td>{% if char.eveaccount_set.count %}{% if char.roles.count %}Yes{% else %}No{% endif %}{% endif %}<td>{% if char.eveaccount_set.count %}Yes{% else %}<span style="color: red;">No</span>{% endif %}</td></tr>
|
||||
<tr><td><a href="{% url eveapi-character char.id %}">{{ char.name }}</a></td><td>{% if char.total_sp %}{{ char.total_sp|intcomma }} SP{% endif %}</td><td>{{ char.corporation_date }}</td><td>{% if char.director %}Yes{% endif %}</td><td>{% if char.eveaccount_set.count %}{% if char.roles.count %}Yes{% else %}No{% endif %}{% endif %}<td>{% if char.eveaccount_set.count %}Yes{% else %}<span style="color: red;">No</span>{% endif %}</td><td>{% if char.active_key %}Yes{% else %}<span style="color: red;">No</span>{% endif %}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% paginate %}
|
||||
|
||||
Reference in New Issue
Block a user