fix if condition in pretty_domain_name (#1008)

This commit is contained in:
steschuser 2021-10-30 21:29:55 +02:00 committed by GitHub
parent 46e51f16cb
commit ba2423d6f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,7 +246,7 @@ def pretty_domain_name(value):
"""
if isinstance(value, str):
if value.startswith('xn--') \
or value.find('.xn--'):
or value.find('.xn--') != -1:
try:
return value.encode().decode('idna')
except: