mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Use distinct counts, avoid duplicating up on API keys
This commit is contained in:
@@ -38,12 +38,12 @@ class EVEPlayerCorporation(EVEAPIModel):
|
||||
@property
|
||||
def api_keys(self):
|
||||
""" Returns the number of characters with stored API keys """
|
||||
return self.eveplayercharacter_set.filter(eveaccount__isnull=False).count()
|
||||
return self.eveplayercharacter_set.filter(eveaccount__isnull=False).distinct().count()
|
||||
|
||||
@property
|
||||
def active_api_keys(self):
|
||||
""" Returns the number of characters with stored and active API keys """
|
||||
return self.eveplayercharacter_set.filter(eveaccount__isnull=False, eveaccount__api_status=API_STATUS_OK).count()
|
||||
return self.eveplayercharacter_set.filter(eveaccount__isnull=False, eveaccount__api_status=API_STATUS_OK).distinct().count()
|
||||
|
||||
@property
|
||||
def director_api_keys(self):
|
||||
|
||||
Reference in New Issue
Block a user