301 Commits

Author SHA1 Message Date
Alex Vandiver
a925671179 corporate: Add canonical URLs. 2025-10-21 14:25:16 -07:00
Anders Kaseorg
e9abaacd5c ruff: Fix PYI061 Use None rather than Literal[None].
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-30 16:47:54 -07:00
Aman Agrawal
40f4ad2cb0 register: Add AI/LLM as option for how user found Zulip. 2025-09-24 10:24:23 -07:00
Mateusz Mandera
072f234269 confirmation: Rename REALM_CREATION to NEW_REALM_USER_REGISTRATION.
Clears up some naming confusion - `REALM_CREATION_LINK_VALIDITY_DAYS` is
a setting which describes the validaty period of RealmCreationKey, not
of Confirmation with REALM_CREATION type. Now that the latter is called
NEW_REALM_USER_REGISTRATION, there should be no confusion about this.
2025-08-04 18:41:00 -07:00
Aman Agrawal
9b15dce1b2 auth: Only automatically redirect for same domain redirects.
If the `deactivated_redirect` belongs to the same domain as
`EXTERNAL_HOST`, automatically redirect, otherwise just point
user to the new URL.
2025-07-10 10:46:59 -07:00
Anders Kaseorg
717cf60edf python: Use Django 5.2 reverse(…, query=…).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-12 09:32:38 -07:00
Anders Kaseorg
b10bf1dd20 remote_billing_page: Fix redirect on serverlogin/…/confirm/ error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-12 09:32:38 -07:00
Aman Agrawal
87694e9606 support: Add field to ask type of hosting request in demo form. 2025-06-04 16:29:03 -07:00
Lauryn Menard
6326b07905 billing: Update CustomerPlan.invoiced_through documentation.
Clarify what the invoiced_through field on a CustomerPlan indicates
after the changes to the billing state machine as ledger entries
are processed in invoice_plan.

Updates the plan activity page where this field is shown to support
admin users for these changes as well.

Follow-up to #34643.
2025-05-20 07:05:02 -07:00
Lauryn Menard
4d1bfe6537 demo-orgs: Disable corporate upgrade and sponsorship pages.
Use a shared error template for demo organizations when rendering
the upgrade or sponsorship pages.

Demo organizations must be converted into a permanent organization,
i.e., not be automatically scheduled for deletion, to either apply
for a sponsorship/discount or upgrade to a paid plan.
2025-04-23 09:23:24 -07:00
Ethan Mayer
c12b94aea4 models: Refactor corporate/models.py into models package.
Fixes #34318.

Seperated models file into a package with component files.
2025-04-08 10:16:35 -07:00
Vector73
158fd58cde settings: Add "can_manage_billing_group" realm setting.
Added "can_manage_billing_group" realm group permission setting
to control who can manage billing and plans in the organization.

Fixes #32745.
2025-03-10 09:36:30 -07:00
Lauryn Menard
bc20a0f086 support: Update "temporary courtesy" to "complimentary access".
Updates support actions for "temporary courtesy" plans to instead
use "complimentary access" to refer to these plans and actions.

Prep for implementing a complimentary access plan for Zulip Cloud.
2025-01-21 15:40:27 -08:00
Lauryn Menard
9fdaa9de0c portico: Fix logic for scheduled upgrade context variables.
Renames context variables used for the pricing model template for
when the customer has a current plan that has an upgrade to a new
plan tier scheduled.

Fixes the "Upgrade scheduled" note that was being shown when an
annual fixed-price plan has a subsequent fixed-price plan scheduled
to start when the current plan ends.

Prep for adding a complimentary access plan for Zulip Cloud.
2025-01-21 15:39:13 -08:00
Anders Kaseorg
f223251ffe requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-14 09:42:16 -08:00
Lauryn Menard
c01787f41a corporate: Clean up vestiges of migrating plans to multiple realms.
In commit ea863bab5b, handle_customer_migration_from_server_to_realm
was updated to only move a remote server's plan in the case that there
is only one remote realm on the server.
2024-12-31 16:54:40 -08:00
Anders Kaseorg
19b8cde27f ruff: Fix PLC0206 Extracting value from dictionary without calling .items().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-21 21:06:53 -08:00
Lauryn Menard
b6f8c20772 stripe: Rename get_legacy_remote_server_next_plan_name.
Rename get_legacy_remote_server_next_plan_name to
get_complimentary_access_next_plan_name, as well as all
associated variables.
2024-12-15 09:15:07 -08:00
Lauryn Menard
a0bbc62f2b support: Add fixed-price plan configuration to Cloud support view.
Adds ability to configure a fixed-price plan and to delete a
configured fixed-price plan in the Cloud support view.

Updates the invoice processing to send reminder emails to the
billing support email for these Cloud fixed-price plans about
renewals since we now are able to configure them via our support
panel.

Updates function to get the billing session for stripe webhook
events to handle an intial upgrade for a custom generated invoice
for a fixed-price plan for a Cloud organization, which won't have
a user_id in the invoice metadata.
2024-11-26 12:42:39 -08:00
Lauryn Menard
89b5e850b2 support: Implement setting a current plan end date for Cloud support.
Prep for implementing fixed-price plan offers in Cloud support view.
2024-11-26 12:42:39 -08:00
Lauryn Menard
6376fb7fec support: Remove count check of keys in Cloud support view.
This check made sense before the support view expanded with the
billing system work over this past year. As we continue to expand
the actions/features of the support views, it's likely we'll have
cases where we're passing more values for particular features.

Prep for implementing fixed-price plan offers in Cloud support view.
2024-11-26 12:42:39 -08:00
Lauryn Menard
84dddbd496 support: Pass remote_support_view boolean in context for views.
Many of the templates for the remote and Cloud support views are
designed to be shared, but some features/actions have not yet been
implemented for both types of support views.

Adds a remote_support_view boolean to each type of support view
context so that it's easy to add checks to existing templates.

Updates the Cloud support view to use the current_plan_forms_support
template, and fixes existing bug of offering the upgrade to Plus
option for modifying a Cloud plan when the current plan is a
fixed-price plan.

Prep for implementing fixed-price plan offers in Cloud support view.
2024-11-26 12:42:39 -08:00
Aman Agrawal
d86f0172e1 support: Add form for sales support queries. 2024-11-25 16:53:33 -08:00
Lauryn Menard
7416e9c29c support: Consolidate logic for generating support URLs.
The build_support_url is a more generic function that's used in
the BillingSession framework and will generate the same URL for
these Zulip Cloud support requests.
2024-11-05 08:56:24 -08:00
Lauryn Menard
44a25e00b7 remote-activity: Show remote realm mobile user and push data.
Updates the main query and logic for building the remote activity
table to use remote server mobile user/push data for server rows
and remote realm mobile user/push data for realm rows.
2024-10-24 12:51:53 -07:00
Aman Agrawal
b6c37a3474 register: Ask which review site for how found zulip. 2024-09-27 13:23:08 -07:00
Aman Agrawal
ee85e750f7 activity: Show ad and organization extra context. 2024-09-27 13:23:08 -07:00
Aman Agrawal
790d5c44a1 stripe: Allow customer to switch license management type.
Fixes #28633

Added a button to switch license management type on billing page.

Tested that the plan switch works correctly.

Tested that when switching from manual to automatic license
management, customer is only billed for billable users for the
next billing cycle.
2024-09-26 16:13:28 -07:00
Anders Kaseorg
f0f048de69 corporate: Import corporate.lib.stripe lazily.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-24 18:18:26 -07:00
Anders Kaseorg
5e62903d29 corporate: Use Literal types for upgrade parameters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-24 18:18:26 -07:00
Lauryn Menard
a89deb5e5c activity: Use icon for activity links and realm name for support view.
In the installation and integrations activity views, updates the
links to a realm's activity view to use the 'fa fa-table' icon,
instead of the realm name. Now, the realm name links instead to
the realm's support page.

Also, the integrations activity page now includes a link to a
realm's stats view.
2024-09-24 10:37:22 -07:00
Lauryn Menard
55d7ec843e installation-activity: Add export version of chart.
Adds a boolean export parameter to the installation activity view.

When true, the initial links column is removed from the chart, a
blank column is removed before human message counts anda column
with all organization owner and admin emails is added.

Updates the links at the top of the installation activity page to
have an option to toggle between the export and non-export versions
of the chart.
2024-09-24 10:37:22 -07:00
Lauryn Menard
c2abb5b4a7 installation-activity: Loop through realm data once.
Refactor processing the data for the realm summary table so that it
only loops through the data once.
2024-09-24 10:37:22 -07:00
Lauryn Menard
52bc47a870 activity: Add view for a remote server's audit logs.
Links to the audit log view via the remote support view in the
remote server information section after the user counts.
2024-09-17 09:34:17 -07:00
Aman Agrawal
ed0104ceb9 installation_activity: Show extra data for Other referrer. 2024-09-17 09:15:14 -07:00
Lauryn Menard
56c8cbde1e audit-log: Move realm event types to AuditLogEventType enum.
Event types moved: REALM_CREATED, REALM_DEFAULT_USER_SETTINGS_CHANGED
REALM_ORG_TYPE_CHANGED, REALM_DOMAIN_ADDED, REALM_DOMAIN_CHANGED
REALM_DOMAIN_REMOVED, REALM_PLAYGROUND_ADDED, REALM_PLAYGROUND_REMOVED
REALM_LINKIFIER_ADDED, REALM_LINKIFIER_CHANGED, REALM_LINKIFIER_REMOVED
REALM_EMOJI_ADDED, REALM_EMOJI_REMOVED, REALM_LINKIFIERS_REORDERED
REALM_IMPORTED
2024-09-09 11:50:13 -07:00
Lauryn Menard
d796deddf8 activity: Add invoiced through information to plan activity view.
Expands the header information on the plan activity view to include
the license ledger that was set as invoiced_through when the last
billing cycle generated an invoice.

Also, updates the name of the header information for the next
invoice date to match what's show in the support view for the plan.
2024-08-29 12:00:38 -07:00
Lauryn Menard
d1e7c082b3 activity: Add header area to user activity view. 2024-08-28 14:12:36 -07:00
Lauryn Menard
d54ca85de2 activity: Add view to see the ledger entries for a customer plan.
Adds a link to the plan ledger view in the current plan information
shown in the support views. Link is not shown if the plan is 100%
sponsored, e.g., the Community plan.

Adds a formatted header area to the activity table template so
that it's easy to add useful information to these activity views.
2024-08-28 14:12:36 -07:00
Lauryn Menard
44e73eecc1 support: Add basic information about realm.
Adds non-form section to Zulip Cloud support view with some basic
realm information: organization type, plan type, non-guest user
count and guest user count.

Uses a shared template for the basic realm data and adds a shared
support context dict for variables that are used in both remote
and Zulip Cloud support views.
2024-08-26 20:52:38 -07:00
Lauryn Menard
7af87c7e14 realm-settings: Get max invites for realm plan type helper.
There are a few places where we want to set the max invites for a
realm to the default for a realm's plan type, so this creates a
helper function that can be used consistently to get that default
value.
2024-08-26 08:29:50 -07:00
Lauryn Menard
d708c3c039 support: Add ability to update max daily invitations for realm.
Adds some validation for changing the realm's max invites via the
support view so that it is not set below the default max for the
realm's plan type, and so that if it's currently set to the default
max it's not reset to that same value.
2024-08-23 16:08:30 -07:00
Lauryn Menard
31c32bcba7 support: Remove abbreviation for "Organization type". 2024-08-20 09:45:49 -07:00
Lauryn Menard
3d58a7ec04 remote-support: Add ability to configure temporary courtesy plan.
Expands section for scheduling plans in the remote support view to
have a form to create a temporary courtesy plan (aka our legacy
plan for remote servers and realms).

Form is not shown if there is a current plan for the remote billing
entity, and would raise a SupportRequestError in that case as well.
2024-08-16 16:40:18 -07:00
Lauryn Menard
73029c8348 support: Show sponsorship and discount headers for Zulip Cloud. 2024-08-15 09:51:35 -07:00
Anders Kaseorg
818bad300e corporate: Set assume_scheme="https" for django.forms.URLField.
The previous default of "http" is deprecated and will change to
"https" in Django 6.0.

https://docs.djangoproject.com/en/5.0/releases/5.0/#id2
https://docs.djangoproject.com/en/5.0/ref/forms/fields/#django.forms.URLField.assume_scheme

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-16 13:40:59 -07:00
Kenneth Rodrigues
a7da24a36f validators: Use cleaner syntax for AfterValidator.
Created a function that returns an `AfterValidator` for `check_int_in`
and `check_string_in` instead of having to use a
`lambda` wraper everytime.
2024-07-15 16:49:32 -07:00
Anders Kaseorg
fe71eaa8f0 ruff: Fix FURB148 enumerate index or value is unused.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-14 13:54:32 -07:00
Anders Kaseorg
9a2c80dcb6 ruff: Fix FURB132 Use discard instead of check and remove.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-14 13:54:04 -07:00
Anders Kaseorg
6412c2d630 ruff: Fix FURB142 Use of set.add() in a for loop.
This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-14 13:52:59 -07:00