def check_required_credentials(self, error=True):
    keys = list(self.requiredCredentials.keys())
    for key in keys:
        if (self.requiredCredentials[key] and (not getattr(self, key))):
            if error:
                self.raise_error(AuthenticationError, details=(('requires `' + key) + '`'))
            else:
                return error
def check_required_credentials(self, error=True):
    keys = list(self.requiredCredentials.keys())
    for key in keys:
        if (self.requiredCredentials[key] and (not getattr(self, key))):
            if error:
                self.raise_error(AuthenticationError, details=(('requires `' + key) + '`'))
            else:
                return error