mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-06 16:34:50 -05:00
Update chat view decorators
This commit is contained in:
parent
3414a6b3dd
commit
05fc5645f1
@ -1160,8 +1160,14 @@ class DocumentViewSet(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(ensure_csrf_cookie, name="dispatch")
|
@method_decorator(
|
||||||
@method_decorator(login_required, name="dispatch")
|
[
|
||||||
|
ensure_csrf_cookie,
|
||||||
|
login_required,
|
||||||
|
cache_control(no_cache=True),
|
||||||
|
],
|
||||||
|
name="dispatch",
|
||||||
|
)
|
||||||
class ChatStreamingView(View):
|
class ChatStreamingView(View):
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
request.compress_exempt = True
|
request.compress_exempt = True
|
||||||
@ -1197,7 +1203,6 @@ class ChatStreamingView(View):
|
|||||||
stream_chat_with_documents(query_str=question, documents=documents),
|
stream_chat_with_documents(query_str=question, documents=documents),
|
||||||
content_type="text/event-stream",
|
content_type="text/event-stream",
|
||||||
)
|
)
|
||||||
response["Cache-Control"] = "no-cache"
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user