Workaround for zero key situtations

This commit is contained in:
2011-07-19 13:25:37 +01:00
parent eacd182b81
commit d2b15857cc

View File

@@ -53,7 +53,11 @@ class EVEPlayerCorporation(EVEAPIModel):
membercount = self.eveplayercharacter_set.count()
else:
membercount = self.member_count
return (float(self.api_keys) / membercount) * 100
if len(self.api_keys) and membercount:
return (float(self.api_keys) / membercount) * 100
else:
return float(0.0)
@property
def average_sp(self):