Improve the huddle hashing keys.

(imported from commit e8e1f1ac3022f3cecfdd22d1d4f319cc4f1ce886)
This commit is contained in:
Tim Abbott 2012-09-05 10:24:01 -04:00
parent 6de871a698
commit 7105ea9290
1 changed files with 1 additions and 3 deletions

View File

@ -126,9 +126,7 @@ class Huddle(models.Model):
huddle_hash = models.CharField(max_length=40)
def get_huddle(id_list):
hash_key = ''
for uid in sorted(id_list):
hash_key += str(uid) + ', '
hash_key = ",".join([str(x) for x in sorted(id_list)])
huddle_hash = hashlib.sha1(hash_key).hexdigest()
if Huddle.objects.filter(huddle_hash=huddle_hash):
return Huddle.objects.get(huddle_hash=huddle_hash)