2018-09-25 12:24:11 +02:00
|
|
|
from typing import Any
|
|
|
|
|
2020-05-05 12:25:47 +02:00
|
|
|
from django.conf.urls import include
|
|
|
|
from django.urls import path
|
2020-06-11 00:54:34 +02:00
|
|
|
from django.views.generic import TemplateView
|
2018-09-25 12:24:11 +02:00
|
|
|
|
2020-09-22 05:31:38 +02:00
|
|
|
from corporate.views import (
|
|
|
|
billing_home,
|
|
|
|
change_plan_status,
|
|
|
|
initial_upgrade,
|
|
|
|
replace_payment_source,
|
|
|
|
sponsorship,
|
|
|
|
upgrade,
|
|
|
|
)
|
2020-09-22 06:04:45 +02:00
|
|
|
from zerver.lib.rest import rest_path
|
2013-11-05 23:50:19 +01: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 = [
|
2013-11-06 12:50:13 +01:00
|
|
|
# Zephyr/MIT
|
2020-05-05 12:25:47 +02:00
|
|
|
path('zephyr/', TemplateView.as_view(template_name='corporate/zephyr.html')),
|
|
|
|
path('zephyr-mirror/', TemplateView.as_view(template_name='corporate/zephyr-mirror.html')),
|
2018-09-25 12:24:11 +02:00
|
|
|
|
2020-05-05 12:25:47 +02:00
|
|
|
path('jobs/', TemplateView.as_view(template_name='corporate/jobs.html')),
|
2018-11-08 22:43:55 +01:00
|
|
|
|
2018-09-25 12:24:11 +02:00
|
|
|
# Billing
|
2020-09-22 05:31:38 +02:00
|
|
|
path('billing/', billing_home),
|
|
|
|
path('upgrade/', initial_upgrade, name='initial_upgrade'),
|
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
|
|
|
]
|
2018-09-25 12:24:11 +02:00
|
|
|
|
|
|
|
v1_api_and_json_patterns = [
|
2020-09-22 06:04:45 +02:00
|
|
|
rest_path('billing/upgrade',
|
|
|
|
POST=upgrade),
|
|
|
|
rest_path('billing/sponsorship',
|
|
|
|
POST=sponsorship),
|
|
|
|
rest_path('billing/plan/change',
|
|
|
|
POST=change_plan_status),
|
|
|
|
rest_path('billing/sources/change',
|
|
|
|
POST=replace_payment_source),
|
2016-05-19 17:33:30 +02:00
|
|
|
]
|
2016-03-21 03:13:38 +01:00
|
|
|
|
2018-09-25 12:24:11 +02:00
|
|
|
# Make a copy of i18n_urlpatterns so that they appear without prefix for English
|
|
|
|
urlpatterns = list(i18n_urlpatterns)
|
|
|
|
|
|
|
|
urlpatterns += [
|
2020-05-05 12:25:47 +02:00
|
|
|
path('api/v1/', include(v1_api_and_json_patterns)),
|
|
|
|
path('json/', include(v1_api_and_json_patterns)),
|
2018-09-25 12:24:11 +02:00
|
|
|
]
|