More empty handle checks in proxies

This commit is contained in:
Nick Hall 2015-12-12 21:51:25 +00:00
parent 4e1b72ab60
commit cff726a4bb
2 changed files with 13 additions and 9 deletions

View File

@ -146,12 +146,14 @@ class LivingProxyDb(ProxyDbBase):
def get_default_person(self):
"""returns the default Person of the database"""
person_handle = self.db.get_default_handle()
if person_handle:
return self.get_person_from_handle(person_handle)
return None
def get_default_handle(self):
"""returns the default Person of the database"""
person_handle = self.db.get_default_handle()
if self.get_person_from_handle(person_handle):
if person_handle and self.get_person_from_handle(person_handle):
return person_handle
return None

View File

@ -312,6 +312,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_default_handle(self):
"""returns the default Person of the database"""
handle = self.db.get_default_handle()
if handle:
person = self.db.get_person_from_handle(handle)
if person and not person.get_privacy():
return handle
@ -640,6 +641,7 @@ def sanitize_lds_ord(db, lds_ord):
new_lds_ord.set_temple(lds_ord.get_temple())
fam_handle = lds_ord.get_family_handle()
if fam_handle:
fam = db.get_family_from_handle(fam_handle)
if fam and not fam.get_privacy():
new_lds_ord.set_family_handle(fam_handle)