Merge pull request #2535 from alphagov/launch-first-class

Launch first class postage feature
This commit is contained in:
Chris Hill-Scott
2018-11-26 16:33:21 +00:00
committed by GitHub
3 changed files with 41 additions and 33 deletions

View File

@@ -552,8 +552,12 @@ def service_set_letters(service_id):
@main.route("/services/<service_id>/service-settings/set-postage", methods=['GET', 'POST'])
@login_required
@user_is_platform_admin
@user_has_permissions('manage_service')
def service_set_postage(service_id):
if not current_service.has_permission('letter'):
abort(404)
form = ServicePostageForm(postage=current_service.postage)
if form.validate_on_submit():

View File

@@ -234,20 +234,18 @@
)}}
{% endcall %}
{% if current_user.platform_admin %}
{% call settings_row(if_has_permission='letter') %}
{{ text_field('Postage') }}
{% set postage = {'first': 'First class only', 'second': 'Second class only'} %}
{{ text_field(postage[current_service.postage]) }}
{{ edit_field(
'Change',
url_for('.service_set_postage',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
{% endif %}
{% call settings_row(if_has_permission='letter') %}
{{ text_field('Postage') }}
{% set postage = {'first': 'First class only', 'second': 'Second class only'} %}
{{ text_field(postage[current_service.postage]) }}
{{ edit_field(
'Change',
url_for('.service_set_postage',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
{% endcall %}
</div>