Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace authored Jul 17, 2024
1 parent 5a2abcc commit 3601e3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assistant/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def send_message_to_thread(request, thread_id):
@require_sponsor_tier
@require_POST
def share_thread(request, thread_id):
thread = get_object_or_404(Thread, id=thread_id, creator=request.user)
if request.user.is_superuser:
thread = get_object_or_404(Thread, id=thread_id)
else:
thread = get_object_or_404(Thread, id=thread_id, creator=request.user)
new_shared_thread = SharedThread(creator=request.user, thread=thread)
openai_thread_id = thread.openai_thread_id
openai_thread_messages = client.beta.threads.messages.list(openai_thread_id, order='asc', limit=100)
Expand Down

0 comments on commit 3601e3b

Please sign in to comment.