mirror of https://github.com/MISP/misp-dashboard
Prevent duplication of org in Lsat contributors
parent
0e1291c813
commit
158532aa86
|
@ -231,10 +231,13 @@ class Contributor_helper:
|
||||||
keyname = "CONTRIB_LAST"
|
keyname = "CONTRIB_LAST"
|
||||||
prev_days = 7
|
prev_days = 7
|
||||||
topNum = self.MAX_NUMBER_OF_LAST_CONTRIBUTOR # default Num
|
topNum = self.MAX_NUMBER_OF_LAST_CONTRIBUTOR # default Num
|
||||||
|
addedOrg = []
|
||||||
data = []
|
data = []
|
||||||
for curDate in util.getXPrevDaysSpan(date, prev_days):
|
for curDate in util.getXPrevDaysSpan(date, prev_days):
|
||||||
last_contrib_org = self.getZrange(keyname, curDate, topNum)
|
last_contrib_org = self.getZrange(keyname, curDate, topNum)
|
||||||
for org, sec in last_contrib_org:
|
for org, sec in last_contrib_org:
|
||||||
|
if org in addedOrg:
|
||||||
|
continue
|
||||||
dic = {}
|
dic = {}
|
||||||
dic['rank'] = self.getOrgRankFromRedis(org, date)
|
dic['rank'] = self.getOrgRankFromRedis(org, date)
|
||||||
dic['orgRank'] = self.getOrgContributionRank(org)['final_rank']
|
dic['orgRank'] = self.getOrgContributionRank(org)['final_rank']
|
||||||
|
@ -244,6 +247,7 @@ class Contributor_helper:
|
||||||
dic['pnts'] = self.getOrgPntFromRedis(org, date)
|
dic['pnts'] = self.getOrgPntFromRedis(org, date)
|
||||||
dic['epoch'] = sec
|
dic['epoch'] = sec
|
||||||
data.append(dic)
|
data.append(dic)
|
||||||
|
addedOrg.append(org)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue