From dda37b6538880de45731c3c0fae9848e3067735d Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 30 Oct 2018 14:48:44 +0000 Subject: [PATCH] Remove unimplemented methods on service model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the migration from the model inhereting from a `dict` to being a plain object it was useful to have these exceptions raised for quicker debugging. Now that all the code which relied on these methods has gone it’s OK to remove them (attempts to call them will fall through to Python’s native exception handling). --- app/models/service.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/models/service.py b/app/models/service.py index e9b1e7ae4..c663962d3 100644 --- a/app/models/service.py +++ b/app/models/service.py @@ -47,16 +47,6 @@ class Service(): return self._dict[attr] raise AttributeError('`{}` is not a service attribute'.format(attr)) - def __getitem__(self, attr): - raise NotImplementedError( - 'Use current_service.{} instead of current_service[\'{}\']'.format(attr, attr) - ) - - def get(self, attr, default=None): - raise NotImplementedError( - 'Use current_service.{} instead of current_service.get(\'{}\')'.format(attr, attr) - ) - @property def trial_mode(self): return self._dict['restricted']