mirror of https://github.com/zulip/zulip.git
python: Sort imports in easy files in zerver/.
This commit is contained in:
parent
a996f843d1
commit
10ab9410c9
|
@ -1,12 +1,11 @@
|
|||
|
||||
from django.apps import AppConfig
|
||||
from django.db.models.signals import post_migrate
|
||||
from django.core.cache import cache
|
||||
from django.conf import settings
|
||||
from typing import Any, Dict
|
||||
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
from django.core.cache import cache
|
||||
from django.db.models.signals import post_migrate
|
||||
|
||||
def flush_cache(sender, **kwargs):
|
||||
# type: (AppConfig, **Any) -> None
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
from typing import Any, Dict
|
||||
|
||||
from django.views.debug import SafeExceptionReporterFilter
|
||||
from django.http import HttpRequest
|
||||
from django.views.debug import SafeExceptionReporterFilter
|
||||
|
||||
class ZulipExceptionReporterFilter(SafeExceptionReporterFilter):
|
||||
def get_post_parameters(self, request):
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# System documented in https://zulip.readthedocs.io/en/latest/logging.html
|
||||
|
||||
from django.conf import settings
|
||||
import logging
|
||||
import platform
|
||||
import traceback
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import logging
|
||||
import traceback
|
||||
import platform
|
||||
|
||||
from django.conf import settings
|
||||
from django.core import mail
|
||||
from django.http import HttpRequest
|
||||
from django.utils.log import AdminEmailHandler
|
||||
|
|
|
@ -1,32 +1,31 @@
|
|||
|
||||
from typing import Any, AnyStr, Callable, Dict, Iterable, List, MutableMapping, Optional, Text
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import DisallowedHost
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
from zerver.lib.response import json_error, json_response_from_error
|
||||
from zerver.lib.subdomains import get_subdomain
|
||||
from zerver.lib.exceptions import JsonableError, ErrorCode
|
||||
from django.db import connection
|
||||
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
|
||||
from zerver.lib.utils import statsd
|
||||
from zerver.lib.queue import queue_json_publish
|
||||
from zerver.lib.cache import get_remote_cache_time, get_remote_cache_requests
|
||||
from zerver.lib.bugdown import get_bugdown_time, get_bugdown_requests
|
||||
from zerver.models import Realm, flush_per_request_caches, get_realm
|
||||
from zerver.lib.exceptions import RateLimited
|
||||
from django.contrib.sessions.middleware import SessionMiddleware
|
||||
from django.views.csrf import csrf_failure as html_csrf_failure
|
||||
from django.utils.cache import patch_vary_headers
|
||||
from django.utils.http import cookie_date
|
||||
from django.shortcuts import redirect, render
|
||||
|
||||
import cProfile
|
||||
import logging
|
||||
import time
|
||||
import cProfile
|
||||
import traceback
|
||||
from typing import Any, AnyStr, Callable, Dict, \
|
||||
Iterable, List, MutableMapping, Optional, Text
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sessions.middleware import SessionMiddleware
|
||||
from django.core.exceptions import DisallowedHost
|
||||
from django.db import connection
|
||||
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
|
||||
from django.shortcuts import redirect, render
|
||||
from django.utils.cache import patch_vary_headers
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
from django.utils.http import cookie_date
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.csrf import csrf_failure as html_csrf_failure
|
||||
|
||||
from zerver.lib.bugdown import get_bugdown_requests, get_bugdown_time
|
||||
from zerver.lib.cache import get_remote_cache_requests, get_remote_cache_time
|
||||
from zerver.lib.exceptions import ErrorCode, JsonableError, RateLimited
|
||||
from zerver.lib.queue import queue_json_publish
|
||||
from zerver.lib.response import json_error, json_response_from_error
|
||||
from zerver.lib.subdomains import get_subdomain
|
||||
from zerver.lib.utils import statsd
|
||||
from zerver.models import Realm, flush_per_request_caches, get_realm
|
||||
|
||||
logger = logging.getLogger('zulip.requests')
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
|
||||
from django.dispatch import receiver
|
||||
from django.contrib.auth.signals import user_logged_in
|
||||
from django.conf import settings
|
||||
from django.template import loader
|
||||
from django.utils.timezone import get_current_timezone_name as timezone_get_current_timezone_name
|
||||
from django.utils.timezone import now as timezone_now
|
||||
from typing import Any, Dict, Optional
|
||||
from zerver.lib.send_email import send_email, FromAddress
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.signals import user_logged_in
|
||||
from django.dispatch import receiver
|
||||
from django.template import loader
|
||||
from django.utils.timezone import \
|
||||
get_current_timezone_name as timezone_get_current_timezone_name
|
||||
from django.utils.timezone import now as timezone_now
|
||||
|
||||
from zerver.lib.send_email import FromAddress, send_email
|
||||
from zerver.models import UserProfile
|
||||
|
||||
def get_device_browser(user_agent):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
from typing import Dict, List, Any, Tuple
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
|
||||
|
|
Loading…
Reference in New Issue