Correct permission check for showing APIs

This commit is contained in:
Adarnof 2016-12-13 20:22:09 -05:00
parent 5a9418d792
commit 5f88e7e1a5
2 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ class CorpStats(models.Model):
auth = AuthServicesInfo.objects.get_or_create(user=user)[0]
if auth.main_char_id:
try:
char = EveCharacter.objects.get(id=auth.main_char_id)
char = EveCharacter.objects.get(character_id=auth.main_char_id)
if char.corporation_id == self.corp.corporation_id and user.has_perm('corputils.corp_apis'):
return True
if self.corp.alliance and char.alliance_id == self.corp.alliance.alliance_id and user.has_perm('corputils.alliance_apis'):

View File

@ -14,9 +14,9 @@
{% endif %}
</tr>
<tr>
<td class="text-center">{{ corpstats.corp.corporation_name }}</td>
<td class="text-center"><h4>{{ corpstats.corp.corporation_name }}</h4></td>
{% if corpstats.corp.alliance %}
<td class="text-center">{{ corpstats.corp.alliance.alliance_name }}</td>
<td class="text-center"><h4>{{ corpstats.corp.alliance.alliance_name }}</h4></td>
{% endif %}
</tr>
</table>