mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Black 23 enforces some slightly more specific rules about empty line counts and redundant parenthesis removal, but the result is still compatible with Black 22. (This does not actually upgrade our Python environment to Black 23 yet.) Signed-off-by: Anders Kaseorg <anders@zulip.com>
23 lines
715 B
Python
23 lines
715 B
Python
import os
|
|
|
|
from django.http import HttpRequest, HttpResponse
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
|
|
from zerver.decorator import require_post
|
|
from zerver.lib.cache import get_cache_backend
|
|
from zerver.lib.response import json_success
|
|
from zerver.models import clear_client_cache, flush_per_request_caches
|
|
|
|
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../")
|
|
|
|
|
|
# This is used only by the Puppeteer tests to clear all the cache after each run.
|
|
@csrf_exempt
|
|
@require_post
|
|
def remove_caches(request: HttpRequest) -> HttpResponse:
|
|
cache = get_cache_backend(None)
|
|
cache.clear()
|
|
clear_client_cache()
|
|
flush_per_request_caches()
|
|
return json_success(request)
|