'Ensure model has token data before saving'

def save(self, *args, **kwargs):

    try:
        token = self.provider_data.get('token')
    except (AttributeError, TypeError):
        token = None
    finally:
        if (token is None):
            token = default_token()
            self.provider_data = {'token': token}
    super(GenericAPIWebhook, self).save(*args, **kwargs)
