mirror of https://github.com/zulip/zulip.git
Improve the huddle hashing keys.
(imported from commit e8e1f1ac3022f3cecfdd22d1d4f319cc4f1ce886)
This commit is contained in:
parent
6de871a698
commit
7105ea9290
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue