Fix KeyError : geo attribute can not exists

This commit is contained in:
Gregory Soutade 2017-08-23 20:10:15 +02:00
parent 83227cfad2
commit 3b3ae1ea3e

View File

@ -82,7 +82,7 @@ class IWLADisplayTopGeo(IPlugin):
def hook(self): def hook(self):
display = self.iwla.getDisplay() display = self.iwla.getDisplay()
geo = self.iwla.getMonthStats()['geo'] geo = self.iwla.getMonthStats().get('geo', {})
geo = sorted(geo.items(), key=lambda t: t[1], reverse=True) geo = sorted(geo.items(), key=lambda t: t[1], reverse=True)
self.valid_visitors = self.iwla.getValidVisitors() self.valid_visitors = self.iwla.getValidVisitors()