Fix get_huddle handling of id_list.

(imported from commit 0fe1ee15b2fc6b3bef98ac47f1094b89e776c751)
This commit is contained in:
Tim Abbott
2012-09-05 11:38:09 -04:00
parent 254b118bd6
commit 3e51ef8c1c

View File

@@ -126,7 +126,8 @@ class Huddle(models.Model):
huddle_hash = models.CharField(max_length=40)
def get_huddle(id_list):
hash_key = ",".join([str(x) for x in sorted(list(set(id_list)))])
id_list = sorted(set(id_list))
hash_key = ",".join([str(x) for x in 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)