<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, user, **kwargs):
 """If parent resource is not an editable state, should not be able to update"""

        yield self.get_parent()

        if not self.parent.editable:
            err = 'Cannot update child of {} resource'.format(self.parent.state.name)
            raise exceptions.Unauthorized(err)

        yield super(SubResource, self).update(user, **kwargs)