diff --git a/docs/directory-structure.md b/docs/directory-structure.md index 2e5d58af2e..d16bfd3c15 100644 --- a/docs/directory-structure.md +++ b/docs/directory-structure.md @@ -23,7 +23,7 @@ paths will be familiar to Django developers. * `zerver/views/webhooks/` Webhook views for [Zulip integrations](integration-guide.html). -* `zerver/tornadoviews.py` Tornado views. +* `zerver/tornado/views.py` Tornado views. * `zerver/worker/queue_processors.py` [Queue workers](queuing.html). diff --git a/tools/lint-all b/tools/lint-all index ab6a68a693..b75bd95e65 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -290,7 +290,7 @@ def build_custom_checkers(by_lang): # are already captured ('zerver/middleware.py', 'return json_error(exception.to_json_error_msg(), status=status_code)'), - ('zerver/tornadoviews.py', 'return json_error(result["message"])'), + ('zerver/tornado/views.py', 'return json_error(result["message"])'), ('zerver/views/invite.py', 'return json_error(data=error_data, msg=ret_error)'), ('zerver/views/streams.py', 'return json_error(property_conversion)'), diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 9199dc6f5d..ddec82e856 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -64,7 +64,7 @@ from zerver.lib.validator import ( from zerver.views.events_register import _default_all_public_streams, _default_narrow -from zerver.tornadoviews import get_events_backend +from zerver.tornado.views import get_events_backend from collections import OrderedDict import mock diff --git a/zerver/tests/test_tornado.py b/zerver/tests/test_tornado.py index c77ae3bc43..7a0c7941ad 100644 --- a/zerver/tests/test_tornado.py +++ b/zerver/tests/test_tornado.py @@ -29,7 +29,7 @@ from tornado.web import Application from tornado.websocket import websocket_connect from zerver.tornado.application import create_tornado_application -from zerver.tornadoviews import get_events_backend +from zerver.tornado.views import get_events_backend from six.moves.http_cookies import SimpleCookie diff --git a/zerver/tornadoviews.py b/zerver/tornado/views.py similarity index 100% rename from zerver/tornadoviews.py rename to zerver/tornado/views.py diff --git a/zproject/urls.py b/zproject/urls.py index ea02cf1caa..6fc9b41b73 100644 --- a/zproject/urls.py +++ b/zproject/urls.py @@ -13,6 +13,7 @@ from zerver.lib.integrations import WEBHOOK_INTEGRATIONS from django.contrib.auth.views import (login, password_reset, password_reset_done, password_reset_confirm, password_reset_complete) +import zerver.tornado.views import zerver.views import zerver.views.auth import zerver.views.zephyr @@ -22,7 +23,6 @@ import zerver.views.integrations import confirmation.views from zerver.lib.rest import rest_dispatch -from zerver import tornadoviews # NB: There are several other pieces of code which route requests by URL: # @@ -273,10 +273,10 @@ v1_api_and_json_patterns = [ url(r'^register$', rest_dispatch, {'POST': 'zerver.views.events_register.api_events_register'}), - # events -> zerver.tornadoviews + # events -> zerver.tornado.views url(r'^events$', rest_dispatch, - {'GET': 'zerver.tornadoviews.get_events_backend', - 'DELETE': 'zerver.tornadoviews.cleanup_event_queue'}), + {'GET': 'zerver.tornado.views.get_events_backend', + 'DELETE': 'zerver.tornado.views.cleanup_event_queue'}), ] # Include the dual-use patterns twice @@ -334,7 +334,7 @@ for app_name in settings.EXTRA_INSTALLED_APPS: # Tornado views urls += [ # Used internally for communication between Django and Tornado processes - url(r'^notify_tornado$', tornadoviews.notify, name='zerver.tornadoviews.notify'), + url(r'^notify_tornado$', zerver.tornado.views.notify, name='zerver.tornado.views.notify'), ] # Python Social Auth