Skip to content

Commit

Permalink
Check for missing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Hall committed Oct 14, 2024
1 parent dcb0a05 commit 96256c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
10 changes: 6 additions & 4 deletions gramps/gen/lib/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ def get_attrs(self):
return attr_dict

def set_attrs(self, attr_dict):
self.__type = attr_dict["type"]
del attr_dict["type"]
self.__description = attr_dict["description"]
del attr_dict["description"]
if "type" in attr_dict:
self.__type = attr_dict["type"]
del attr_dict["type"]
if "description" in attr_dict:
self.__description = attr_dict["description"]
del attr_dict["description"]
super().set_attrs(attr_dict)

@classmethod
Expand Down
5 changes: 3 additions & 2 deletions gramps/gen/lib/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,9 @@ def get_attrs(self):
return attr_dict

def set_attrs(self, attr_dict):
self.__gender = attr_dict["gender"]
del attr_dict["gender"]
if "gender" in attr_dict:
self.__gender = attr_dict["gender"]
del attr_dict["gender"]
super().set_attrs(attr_dict)

def _has_handle_reference(self, classname, handle):
Expand Down
15 changes: 9 additions & 6 deletions gramps/gen/lib/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,15 @@ def get_attrs(self):
return attr_dict

def set_attrs(self, attr_dict):
self.__name = attr_dict["name"]
del attr_dict["name"]
self.__color = attr_dict["color"]
del attr_dict["color"]
self.__priority = attr_dict["priority"]
del attr_dict["priority"]
if "name" in attr_dict:
self.__name = attr_dict["name"]
del attr_dict["name"]
if "color" in attr_dict:
self.__color = attr_dict["color"]
del attr_dict["color"]
if "priority" in attr_dict:
self.__priority = attr_dict["priority"]
del attr_dict["priority"]
super().set_attrs(attr_dict)

@classmethod
Expand Down

0 comments on commit 96256c9

Please sign in to comment.