3851: NarWeb Associations don't show unless Include Private is checked
svn: r15192
This commit is contained in:
parent
8d9ad55ae6
commit
40f88a9e7d
@ -463,6 +463,27 @@ def copy_notes(db, original_obj, clean_obj):
|
|||||||
if not note.get_privacy():
|
if not note.get_privacy():
|
||||||
clean_obj.add_note(note_handle)
|
clean_obj.add_note(note_handle)
|
||||||
|
|
||||||
|
def copy_associations(db, original_obj, clean_obj):
|
||||||
|
"""
|
||||||
|
Copies associations from one object to another - excluding
|
||||||
|
references to private notes.
|
||||||
|
|
||||||
|
@param db: GRAMPS database to which the references belongs
|
||||||
|
@type db: DbBase
|
||||||
|
@param original_obj: Object that may have private references
|
||||||
|
@type original_obj: Base
|
||||||
|
@param clean_obj: Object that will have only non-private references
|
||||||
|
@type original_obj: Base
|
||||||
|
@returns: Nothing
|
||||||
|
"""
|
||||||
|
new_person_ref_list = []
|
||||||
|
for person_ref in original_obj.get_person_ref_list():
|
||||||
|
if not person_ref.get_privacy():
|
||||||
|
associated_person = db.get_person_from_handle(person_ref.ref)
|
||||||
|
if associated_person and not associated_person.get_privacy():
|
||||||
|
new_person_ref_list.append(person_ref)
|
||||||
|
clean_obj.set_person_ref_list(new_person_ref_list)
|
||||||
|
|
||||||
def copy_attributes(db, original_obj, clean_obj):
|
def copy_attributes(db, original_obj, clean_obj):
|
||||||
"""
|
"""
|
||||||
Copies attributes from one object to another - excluding references to
|
Copies attributes from one object to another - excluding references to
|
||||||
@ -791,6 +812,7 @@ def sanitize_person(db, person):
|
|||||||
copy_media_ref_list(db, person, new_person)
|
copy_media_ref_list(db, person, new_person)
|
||||||
copy_lds_ords(db, person, new_person)
|
copy_lds_ords(db, person, new_person)
|
||||||
copy_notes(db, person, new_person)
|
copy_notes(db, person, new_person)
|
||||||
|
copy_associations(db, person, new_person)
|
||||||
|
|
||||||
return new_person
|
return new_person
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user