mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-22 20:28:09 +00:00
Handle sharing old conversation publically even if they have no slug
New conversation have a slug, but older conversation may not. This change allows those older conversations to still be shareable by using a random uuid for constructing their url instead
This commit is contained in:
parent
90b7ba51a4
commit
1e3f452d15
1 changed files with 1 additions and 1 deletions
|
@ -639,7 +639,7 @@ def verify_public_conversation(sender, instance, **kwargs):
|
|||
|
||||
# check if this is a new instance
|
||||
if instance._state.adding:
|
||||
slug = re.sub(r"\W+", "-", instance.slug.lower())[:50]
|
||||
slug = re.sub(r"\W+", "-", instance.slug.lower())[:50] if instance.slug else uuid.uuid4().hex
|
||||
observed_random_id = set()
|
||||
while PublicConversation.objects.filter(slug=slug).exists():
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue