Exemplo n.º 1
0
 def retire_user(self, user_id):
     url = self.user_info_url.format(user_id=user_id)
     try:
         response = self.session.delete(url)
         data = response.json()
         assert data in (True, False)
     except Exception as exc:  # pylint: disable=broad-except
         # pylint: disable=no-member
         content = exc.response.content if hasattr(exc, 'response') else response.content
         raise BackendProviderCannotRetireUser(content)
     return data
Exemplo n.º 2
0
 def retire_user(self, user_id):
     if self.last_retire_user:
         raise BackendProviderCannotRetireUser(user_id)
     self.last_retire_user = user_id
     return True