mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Use model to update service properties
We have a lot of places in settings where we update something by passing in the `service_id`. `current_service` already knows about `service_id`, so it’s cleaner to encapsulate these updates inside the model.
This commit is contained in:
@@ -47,6 +47,12 @@ class Service():
|
||||
return self._dict[attr]
|
||||
raise AttributeError('`{}` is not a service attribute'.format(attr))
|
||||
|
||||
def update(self, **kwargs):
|
||||
return service_api_client.update_service(self.id, **kwargs)
|
||||
|
||||
def update_with_properties(self, properties):
|
||||
return service_api_client.update_service_with_properties(self.id, properties)
|
||||
|
||||
@property
|
||||
def trial_mode(self):
|
||||
return self._dict['restricted']
|
||||
|
||||
Reference in New Issue
Block a user