mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	I think it's much more cleaner to use PATCH request on /json/billing/plan than using a POST request on /json/billing/plan/change to update the plan.
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
from typing import Any
 | 
						|
 | 
						|
from django.conf.urls import include
 | 
						|
from django.urls import path
 | 
						|
from django.views.generic import TemplateView
 | 
						|
 | 
						|
from corporate.views import (
 | 
						|
    billing_home,
 | 
						|
    initial_upgrade,
 | 
						|
    replace_payment_source,
 | 
						|
    sponsorship,
 | 
						|
    update_plan,
 | 
						|
    upgrade,
 | 
						|
)
 | 
						|
from zerver.lib.rest import rest_path
 | 
						|
 | 
						|
i18n_urlpatterns: Any = [
 | 
						|
    # Zephyr/MIT
 | 
						|
    path("zephyr/", TemplateView.as_view(template_name="corporate/zephyr.html")),
 | 
						|
    path("zephyr-mirror/", TemplateView.as_view(template_name="corporate/zephyr-mirror.html")),
 | 
						|
    path("jobs/", TemplateView.as_view(template_name="corporate/jobs.html")),
 | 
						|
    # Billing
 | 
						|
    path("billing/", billing_home),
 | 
						|
    path("upgrade/", initial_upgrade, name="initial_upgrade"),
 | 
						|
]
 | 
						|
 | 
						|
v1_api_and_json_patterns = [
 | 
						|
    rest_path("billing/upgrade", POST=upgrade),
 | 
						|
    rest_path("billing/sponsorship", POST=sponsorship),
 | 
						|
    rest_path("billing/plan", PATCH=update_plan),
 | 
						|
    rest_path("billing/sources/change", POST=replace_payment_source),
 | 
						|
]
 | 
						|
 | 
						|
# Make a copy of i18n_urlpatterns so that they appear without prefix for English
 | 
						|
urlpatterns = list(i18n_urlpatterns)
 | 
						|
 | 
						|
urlpatterns += [
 | 
						|
    path("api/v1/", include(v1_api_and_json_patterns)),
 | 
						|
    path("json/", include(v1_api_and_json_patterns)),
 | 
						|
]
 |