fix: model helpers defaults
- check cert_info being None - check if access_url dict has corresponding domain Change-Id: I55f20c13429afc4844d4169046d941c5b9ab0691
This commit is contained in:
parent
352a5f0fe9
commit
7f324eb335
|
@ -125,6 +125,6 @@ class Domain(common.DictSerializableModel):
|
||||||
res = super(Domain, self).to_dict()
|
res = super(Domain, self).to_dict()
|
||||||
# cert info is a temporary property when
|
# cert info is a temporary property when
|
||||||
# trying to create cert, so skip serialization
|
# trying to create cert, so skip serialization
|
||||||
if 'cert_info' in res:
|
if 'cert_info' in res and res['cert_info'] is not None:
|
||||||
res['cert_info'] = res['cert_info'].to_dict()
|
res['cert_info'] = res['cert_info'].to_dict()
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -156,7 +156,7 @@ class ProviderDetail(common.DictSerializableModel):
|
||||||
:param domain
|
:param domain
|
||||||
'''
|
'''
|
||||||
for access_url in self.access_urls:
|
for access_url in self.access_urls:
|
||||||
if access_url['domain'] == domain:
|
if access_url.get('domain') == domain:
|
||||||
return access_url
|
return access_url
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue