Changeset - 5af8a48417c4
[Not reviewed]
Dennis Fink - 9 years ago 2016-02-27 13:15:24
dennis.fink@c3l.lu
Fixed not worldmap
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ennstatus/statistics/views.py
Show inline comments
 
@@ -14,31 +14,31 @@
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from collections import defaultdict
 

	
 
from flask import Blueprint, render_template, current_app, jsonify
 

	
 
from ennstatus.status.functions import split_all_servers_to_types
 

	
 
statistics_page = Blueprint('statistics', __name__)
 

	
 

	
 
@statistics_page.route('/worldmap')
 
def worldmap():
 
    return render_template('statistics/worldmap.html')
 

	
 

	
 
@statistics_page.route('/data/worldmap')
 
def data_worldmap():
 
    servers = split_all_servers_to_types()
 
    countries = defaultdict(int)
 

	
 
    for key, value in servers.items():
 
        for server in value:
 
            countries[server['country']] += 1
 
            countries[server.country] += 1
 

	
 
    maximum = max(countries.values())
 

	
 
    countries['max'] = maximum
 

	
 
    return jsonify(countries)
0 comments (0 inline, 0 general)