示例#1
0
  def _remove_fitbit_device(self):
    """Delete Fitbit device."""

    try:
      api = FitbitAPI(self.userid)
      if api.is_ready():
        api.delete_subscription(self.userid)
    except:
      logging.warn('Cannot delete subscription for user %s', userid)

    token_entity = OAuthRequestToken.get_by_key_name(self.userid)
    if token_entity:
        token_entity.delete()