Ignore duplicate servers.

This commit is contained in:
A. Svensson 2015-02-23 19:04:49 +01:00
parent 860c063f1d
commit 24ace58e88

View File

@ -101,8 +101,16 @@ class Command(BaseCommand):
servers = parser.run()
history = PlayerHistory()
now = time.time()
servers_handled = []
for data in servers:
# Prevent empty servers with identical names to other, active servers
# from fucking with the history
if data['title'] in servers_handled:
continue
else:
servers_handled.append(data['title'])
# TODO: do bulk insert instead!
server, created = Server.objects.update_or_create(
title=data['title'],