mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Stop showing priorities for other provider types
This isn't used and showing priorities when we only have a single provider or where they have no effect is unnecessarily confusing. Removing the form makes it clearer that there's only one way to adjust priorities for domestic SMS providers. If we add another email or international SMS provider in future, we would need to rewrite the form here anyway as the priorities need to be adjusted in tandem, not individually.
This commit is contained in:
@@ -1740,12 +1740,6 @@ class EstimateUsageForm(StripWhitespaceForm):
|
||||
return super().validate(*args, **kwargs)
|
||||
|
||||
|
||||
class AdminProviderForm(StripWhitespaceForm):
|
||||
priority = GovukIntegerField(
|
||||
'Priority', [validators.NumberRange(min=1, max=100, message="Must be between 1 and 100")]
|
||||
)
|
||||
|
||||
|
||||
class AdminProviderRatioForm(StripWhitespaceForm):
|
||||
|
||||
ratio = GovukRadiosField(choices=[
|
||||
|
||||
@@ -6,7 +6,7 @@ from werkzeug.utils import redirect
|
||||
|
||||
from app import provider_client
|
||||
from app.main import main
|
||||
from app.main.forms import AdminProviderForm, AdminProviderRatioForm
|
||||
from app.main.forms import AdminProviderRatioForm
|
||||
from app.utils.user import user_is_platform_admin
|
||||
|
||||
PROVIDER_PRIORITY_MEANING_SWITCHOVER = datetime(2019, 11, 29, 11, 0).isoformat()
|
||||
@@ -43,19 +43,6 @@ def add_monthly_traffic(domestic_sms_providers):
|
||||
provider['monthly_traffic'] = round(percentage)
|
||||
|
||||
|
||||
@main.route("/provider/<uuid:provider_id>/edit", methods=['GET', 'POST'])
|
||||
@user_is_platform_admin
|
||||
def edit_provider(provider_id):
|
||||
provider = provider_client.get_provider_by_id(provider_id)['provider_details']
|
||||
form = AdminProviderForm(active=provider['active'], priority=provider['priority'])
|
||||
|
||||
if form.validate_on_submit():
|
||||
provider_client.update_provider(provider_id, form.priority.data)
|
||||
return redirect(url_for('.view_providers'))
|
||||
|
||||
return render_template('views/providers/edit-provider.html', form=form, provider=provider)
|
||||
|
||||
|
||||
@main.route("/provider/edit-sms-provider-ratio", methods=['GET', 'POST'])
|
||||
@user_is_platform_admin
|
||||
def edit_sms_provider_ratio():
|
||||
|
||||
Reference in New Issue
Block a user