Wrap get org methods in class method on model

This means the service and user models have to import one fewer thing,
and matches what we’re doing with the `from_id` class method.
This commit is contained in:
Chris Hill-Scott
2019-06-13 14:23:02 +01:00
parent cb63d44c08
commit 04f6bd8132
3 changed files with 10 additions and 8 deletions

View File

@@ -12,7 +12,6 @@ from app.notify_client.inbound_number_client import inbound_number_client
from app.notify_client.invite_api_client import invite_api_client
from app.notify_client.job_api_client import job_api_client
from app.notify_client.letter_branding_client import letter_branding_client
from app.notify_client.organisations_api_client import organisations_client
from app.notify_client.service_api_client import service_api_client
from app.notify_client.template_folder_api_client import (
template_folder_api_client,
@@ -398,9 +397,7 @@ class Service(JSONModel):
@cached_property
def organisation(self):
return Organisation(
organisations_client.get_service_organisation(self.id)
)
return Organisation.from_service(self.id)
@cached_property
def inbound_number(self):