mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	settings: Replace occurrences of uri with url.
				
					
				
			In #23380 we want to change all occurrences of `uri` with `url`. This commit changes the names of two variables `external_uri_scheme` and `main_site_uri`, who are constructed using `settings` constants.
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| Construct the URL for the {{ integration_display_name }} | Construct the URL for the {{ integration_display_name }} | ||||||
| bot using the bot's API key and email address: | bot using the bot's API key and email address: | ||||||
|  |  | ||||||
| `{{ external_uri_scheme }}bot_email:bot_api_key@{{ api_url_scheme_relative }}{{ integration_url }}` | `{{ external_url_scheme }}bot_email:bot_api_key@{{ api_url_scheme_relative }}{{ integration_url }}` | ||||||
|  |  | ||||||
| Modify the parameters of the URL above, where `bot_email` is | Modify the parameters of the URL above, where `bot_email` is | ||||||
| the bot's URL-encoded email address and `bot_api_key` is the | the bot's URL-encoded email address and `bot_api_key` is the | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ def common_context(user: UserProfile) -> Dict[str, Any]: | |||||||
|         "realm_uri": user.realm.uri, |         "realm_uri": user.realm.uri, | ||||||
|         "realm_name": user.realm.name, |         "realm_name": user.realm.name, | ||||||
|         "root_domain_url": settings.ROOT_DOMAIN_URI, |         "root_domain_url": settings.ROOT_DOMAIN_URI, | ||||||
|         "external_uri_scheme": settings.EXTERNAL_URI_SCHEME, |         "external_url_scheme": settings.EXTERNAL_URI_SCHEME, | ||||||
|         "external_host": settings.EXTERNAL_HOST, |         "external_host": settings.EXTERNAL_HOST, | ||||||
|         "user_name": user.full_name, |         "user_name": user.full_name, | ||||||
|     } |     } | ||||||
| @@ -163,7 +163,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]: | |||||||
|         "login_url": settings.HOME_NOT_LOGGED_IN, |         "login_url": settings.HOME_NOT_LOGGED_IN, | ||||||
|         "only_sso": settings.ONLY_SSO, |         "only_sso": settings.ONLY_SSO, | ||||||
|         "external_host": settings.EXTERNAL_HOST, |         "external_host": settings.EXTERNAL_HOST, | ||||||
|         "external_uri_scheme": settings.EXTERNAL_URI_SCHEME, |         "external_url_scheme": settings.EXTERNAL_URI_SCHEME, | ||||||
|         "realm_uri": realm_uri, |         "realm_uri": realm_uri, | ||||||
|         "realm_name": realm_name, |         "realm_name": realm_name, | ||||||
|         "realm_icon": realm_icon, |         "realm_icon": realm_icon, | ||||||
|   | |||||||
| @@ -541,9 +541,9 @@ def oauth_redirect_to_root( | |||||||
|     mobile_flow_otp: Optional[str] = REQ(default=None), |     mobile_flow_otp: Optional[str] = REQ(default=None), | ||||||
|     desktop_flow_otp: Optional[str] = REQ(default=None), |     desktop_flow_otp: Optional[str] = REQ(default=None), | ||||||
| ) -> HttpResponse: | ) -> HttpResponse: | ||||||
|     main_site_uri = settings.ROOT_DOMAIN_URI + url |     main_site_url = settings.ROOT_DOMAIN_URI + url | ||||||
|     if settings.SOCIAL_AUTH_SUBDOMAIN is not None and sso_type == "social": |     if settings.SOCIAL_AUTH_SUBDOMAIN is not None and sso_type == "social": | ||||||
|         main_site_uri = ( |         main_site_url = ( | ||||||
|             settings.EXTERNAL_URI_SCHEME |             settings.EXTERNAL_URI_SCHEME | ||||||
|             + settings.SOCIAL_AUTH_SUBDOMAIN |             + settings.SOCIAL_AUTH_SUBDOMAIN | ||||||
|             + "." |             + "." | ||||||
| @@ -570,7 +570,7 @@ def oauth_redirect_to_root( | |||||||
|  |  | ||||||
|     params = {**params, **extra_url_params} |     params = {**params, **extra_url_params} | ||||||
|  |  | ||||||
|     return redirect(append_url_query_string(main_site_uri, urllib.parse.urlencode(params))) |     return redirect(append_url_query_string(main_site_url, urllib.parse.urlencode(params))) | ||||||
|  |  | ||||||
|  |  | ||||||
| def handle_desktop_flow( | def handle_desktop_flow( | ||||||
|   | |||||||
| @@ -50,7 +50,7 @@ def add_api_uri_context(context: Dict[str, Any], request: HttpRequest) -> None: | |||||||
|     api_url = settings.EXTERNAL_URI_SCHEME + api_url_scheme_relative |     api_url = settings.EXTERNAL_URI_SCHEME + api_url_scheme_relative | ||||||
|     zulip_url = settings.EXTERNAL_URI_SCHEME + display_host |     zulip_url = settings.EXTERNAL_URI_SCHEME + display_host | ||||||
|  |  | ||||||
|     context["external_uri_scheme"] = settings.EXTERNAL_URI_SCHEME |     context["external_url_scheme"] = settings.EXTERNAL_URI_SCHEME | ||||||
|     context["api_url"] = api_url |     context["api_url"] = api_url | ||||||
|     context["api_url_scheme_relative"] = api_url_scheme_relative |     context["api_url_scheme_relative"] = api_url_scheme_relative | ||||||
|     context["zulip_url"] = zulip_url |     context["zulip_url"] = zulip_url | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ Get Zulip notifications for Stripe events! | |||||||
| Zulip currently supports Stripe events for Charges, Customers, Discounts, | Zulip currently supports Stripe events for Charges, Customers, Discounts, | ||||||
| Sources, Subscriptions, Files, Invoices and Invoice items. | Sources, Subscriptions, Files, Invoices and Invoice items. | ||||||
|  |  | ||||||
| {% if 'http:' in external_uri_scheme %} | {% if 'http:' in external_url_scheme %} | ||||||
|  |  | ||||||
| !!! tip "" | !!! tip "" | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user