mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
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.
This commit is contained in:
committed by
Tim Abbott
parent
84dddbd496
commit
6376fb7fec
@@ -1710,11 +1710,6 @@ class TestSupportEndpoint(ZulipTestCase):
|
||||
m.assert_called_once_with(lear_realm, acting_user=self.example_user("iago"))
|
||||
self.assert_in_success_response(["lear scrubbed"], result)
|
||||
|
||||
with mock.patch("corporate.views.support.do_scrub_realm") as m:
|
||||
result = self.client_post("/activity/support", {"realm_id": f"{lear_realm.id}"})
|
||||
self.assert_json_error(result, "Invalid parameters")
|
||||
m.assert_not_called()
|
||||
|
||||
def test_delete_user(self) -> None:
|
||||
cordelia = self.example_user("cordelia")
|
||||
hamlet = self.example_user("hamlet")
|
||||
|
@@ -17,7 +17,6 @@ from django.shortcuts import render
|
||||
from django.urls import reverse
|
||||
from django.utils.timesince import timesince
|
||||
from django.utils.timezone import now as timezone_now
|
||||
from django.utils.translation import gettext as _
|
||||
from pydantic import AfterValidator, Json, NonNegativeInt
|
||||
|
||||
from confirmation.models import Confirmation, confirmation_url
|
||||
@@ -41,7 +40,6 @@ from zerver.actions.realm_settings import (
|
||||
from zerver.actions.users import do_delete_user_preserving_messages
|
||||
from zerver.decorator import require_server_admin, zulip_login_required
|
||||
from zerver.forms import check_subdomain_available
|
||||
from zerver.lib.exceptions import JsonableError
|
||||
from zerver.lib.rate_limiter import rate_limit_request_by_ip
|
||||
from zerver.lib.realm_icon import realm_icon_url
|
||||
from zerver.lib.send_email import FromAddress, send_email
|
||||
@@ -443,12 +441,6 @@ def support(
|
||||
# realm_id and a field to change.
|
||||
keys = set(request.POST.keys())
|
||||
keys.discard("csrfmiddlewaretoken")
|
||||
REQUIRED_KEYS = 2
|
||||
if monthly_discounted_price is not None or annual_discounted_price is not None:
|
||||
REQUIRED_KEYS = 3
|
||||
|
||||
if len(keys) != REQUIRED_KEYS:
|
||||
raise JsonableError(_("Invalid parameters"))
|
||||
|
||||
assert realm_id is not None
|
||||
realm = Realm.objects.get(id=realm_id)
|
||||
|
Reference in New Issue
Block a user