remove browsableitem

it was only used by the choose service page, and then only in kludgy
ways (eg: creating a list containing one item called "add service"),
so lets rip it out and make this page bespoke. Especially now that it's
changed so much.
This commit is contained in:
Leo Hemsted
2018-03-08 14:15:01 +00:00
parent c651ca3f36
commit 1cd8000236
5 changed files with 28 additions and 85 deletions

View File

@@ -1,7 +1,4 @@
from flask import url_for
from app.notify_client import NotifyAdminAPIClient, _attach_current_user
from app.notify_client.service_api_client import ServicesBrowsableItem
class OrganisationsClient(NotifyAdminAPIClient):
@@ -54,12 +51,3 @@ class OrganisationsClient(NotifyAdminAPIClient):
url="/organisations/unique",
params={"org_id": org_id, "name": name}
)["result"]
class OrganisationBrowsableItem(ServicesBrowsableItem):
def __init__(self, organisation):
self.services = [ServicesBrowsableItem(x) for x in organisation['services']]
super().__init__(organisation)
@property
def link(self):
return url_for('main.organisation_dashboard', org_id=self._item['id'])

View File

@@ -1,9 +1,6 @@
from __future__ import unicode_literals
from flask import url_for
from app.notify_client import NotifyAdminAPIClient, _attach_current_user
from app.utils import BrowsableItem
class ServiceAPIClient(NotifyAdminAPIClient):
@@ -426,21 +423,3 @@ class ServiceAPIClient(NotifyAdminAPIClient):
"updated_by_id": user_id
}
return self.post("/service/{}/delivery-receipt-api".format(service_id), data)
class ServicesBrowsableItem(BrowsableItem):
@property
def title(self):
return self._item['name']
@property
def link(self):
return url_for('main.service_dashboard', service_id=self._item['id'])
@property
def destructive(self):
return False
@property
def hint(self):
return None