catch exception that is raised for update usernames that are not fqdn

This commit is contained in:
Thomas Waldmann 2013-11-06 13:17:23 +01:00
parent 6dfd61d000
commit 9cdddbaa0d

View File

@ -119,7 +119,10 @@ def check_api_auth(username, password):
:return: True if authenticated, False otherwise.
"""
fqdn = username
hosts = Host.filter_by_fqdn(fqdn)
try:
hosts = Host.filter_by_fqdn(fqdn)
except NotImplementedError:
return False
num_hosts = len(hosts)
if num_hosts == 0:
return False