Don’t show trial mode error if making test letter

We don’t want users in trial mode sending real letters. So we’ve
introduced an error message. This error message is also showing up when
users in trial mode and making a test letter (and having the knock on
effect of hiding the download button).

They should be able to make a test letter in trial mode, because it
doesn’t cost anything.
This commit is contained in:
Chris Hill-Scott
2017-08-25 14:17:23 +01:00
parent ea95493b42
commit edf54d8fe0
2 changed files with 37 additions and 3 deletions

View File

@@ -440,9 +440,11 @@ def _check_messages(service_id, template_type, upload_id, letters_as_pdf=False):
choose_time_form=choose_time_form,
back_link=back_link,
help=get_help_argument(),
trying_to_send_letters_in_trial_mode=bool(
current_service['restricted'] and template.template_type == 'letter'
),
trying_to_send_letters_in_trial_mode=all((
current_service['restricted'],
template.template_type == 'letter',
not request.args.get('from_test'),
)),
)