Make user model return a service model, not JSON

This makes it:
- nicer, by having access to sensibly named things like
  `Service.trial_mode` instead of `service['restricted']`.
- less likely to write Jinja code like `service.trail_mode`, which would
  fail silently if `service` was a dictionary
This commit is contained in:
Chris Hill-Scott
2019-06-07 12:38:48 +01:00
parent 062f42b769
commit 71dc650db6
4 changed files with 34 additions and 16 deletions

View File

@@ -367,10 +367,7 @@ def choose_template_to_copy(
else:
return render_template(
'views/templates/copy.html',
services_templates_and_folders=TemplateLists([
Service(service) for service in
current_user.services
], user=current_user),
services_templates_and_folders=TemplateLists(current_user),
search_form=SearchByNameForm(),
)