2017-03-06 08:35:57 +01:00
|
|
|
from typing import Any
|
|
|
|
|
2017-11-16 00:55:49 +01:00
|
|
|
from django.conf.urls import include, url
|
2017-03-06 08:35:57 +01:00
|
|
|
|
2016-10-27 15:05:55 +02:00
|
|
|
import zilencer.views
|
2017-11-16 00:55:49 +01:00
|
|
|
from zerver.lib.rest import rest_dispatch
|
2016-04-27 06:33:37 +02:00
|
|
|
|
python: Convert assignment type annotations to Python 3.6 style.
This commit was split by tabbott; this piece covers the vast majority
of files in Zulip, but excludes scripts/, tools/, and puppet/ to help
ensure we at least show the right error messages for Xenial systems.
We can likely further refine the remaining pieces with some testing.
Generated by com2ann, with whitespace fixes and various manual fixes
for runtime issues:
- invoiced_through: Optional[LicenseLedger] = models.ForeignKey(
+ invoiced_through: Optional["LicenseLedger"] = models.ForeignKey(
-_apns_client: Optional[APNsClient] = None
+_apns_client: Optional["APNsClient"] = None
- notifications_stream: Optional[Stream] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
- signup_notifications_stream: Optional[Stream] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
+ notifications_stream: Optional["Stream"] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
+ signup_notifications_stream: Optional["Stream"] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
- author: Optional[UserProfile] = models.ForeignKey('UserProfile', blank=True, null=True, on_delete=CASCADE)
+ author: Optional["UserProfile"] = models.ForeignKey('UserProfile', blank=True, null=True, on_delete=CASCADE)
- bot_owner: Optional[UserProfile] = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
+ bot_owner: Optional["UserProfile"] = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
- default_sending_stream: Optional[Stream] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
- default_events_register_stream: Optional[Stream] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
+ default_sending_stream: Optional["Stream"] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
+ default_events_register_stream: Optional["Stream"] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
-descriptors_by_handler_id: Dict[int, ClientDescriptor] = {}
+descriptors_by_handler_id: Dict[int, "ClientDescriptor"] = {}
-worker_classes: Dict[str, Type[QueueProcessingWorker]] = {}
-queues: Dict[str, Dict[str, Type[QueueProcessingWorker]]] = {}
+worker_classes: Dict[str, Type["QueueProcessingWorker"]] = {}
+queues: Dict[str, Dict[str, Type["QueueProcessingWorker"]]] = {}
-AUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional[LDAPSearch] = None
+AUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional["LDAPSearch"] = None
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-22 01:09:50 +02:00
|
|
|
i18n_urlpatterns: Any = []
|
2016-04-27 06:33:37 +02:00
|
|
|
|
|
|
|
# Zilencer views following the REST API style
|
2016-06-24 02:26:09 +02:00
|
|
|
v1_api_and_json_patterns = [
|
2016-10-27 23:55:31 +02:00
|
|
|
url('^remotes/push/register$', rest_dispatch,
|
2018-04-29 00:06:26 +02:00
|
|
|
{'POST': 'zilencer.views.register_remote_push_device'}),
|
2016-10-27 23:55:31 +02:00
|
|
|
url('^remotes/push/unregister$', rest_dispatch,
|
2018-04-29 00:07:47 +02:00
|
|
|
{'POST': 'zilencer.views.unregister_remote_push_device'}),
|
2019-11-19 03:12:54 +01:00
|
|
|
url('^remotes/push/unregister/all$', rest_dispatch,
|
|
|
|
{'POST': 'zilencer.views.unregister_all_remote_push_devices'}),
|
2017-05-08 13:48:16 +02:00
|
|
|
url('^remotes/push/notify$', rest_dispatch,
|
|
|
|
{'POST': 'zilencer.views.remote_server_notify_push'}),
|
2018-05-04 01:40:46 +02:00
|
|
|
|
|
|
|
# Push signup doesn't use the REST API, since there's no auth.
|
|
|
|
url('^remotes/server/register$', zilencer.views.register_remote_server),
|
2019-01-31 00:39:02 +01:00
|
|
|
|
2019-10-03 02:01:36 +02:00
|
|
|
# For receiving table data used in analytics and billing
|
2019-01-31 00:39:02 +01:00
|
|
|
url('^remotes/server/analytics$', rest_dispatch,
|
|
|
|
{'POST': 'zilencer.views.remote_server_post_analytics'}),
|
|
|
|
url('^remotes/server/analytics/status$', rest_dispatch,
|
|
|
|
{'GET': 'zilencer.views.remote_server_check_analytics'}),
|
2016-06-24 02:26:09 +02:00
|
|
|
]
|
2016-04-27 06:33:37 +02:00
|
|
|
|
2018-09-25 12:24:11 +02:00
|
|
|
urlpatterns = [
|
2016-04-27 06:33:37 +02:00
|
|
|
url(r'^api/v1/', include(v1_api_and_json_patterns)),
|
|
|
|
url(r'^json/', include(v1_api_and_json_patterns)),
|
2017-03-06 08:17:34 +01:00
|
|
|
]
|