Skip to content

Commit dcc99a1

Browse files
eduralphclaude
andauthored
QuiltView: import Surname for child-add path (#15)
`QuiltView/QuiltView.py:1266` constructs a fresh `Surname()` to attach to a new `Name` when adding a child via the editor, but `Surname` is never imported. Ruff (F821) flags it: F821 Undefined name `Surname` --> QuiltView/QuiltView.py:1266:26 The file already imports `Person, Family, ChildRef, Name` from `gramps.gen.lib` — extend that import to include `Surname`. Without it, the add-child path raises `NameError` instead of opening the editor. This PR addresses only the `Surname` F821. Two other F821 sites in the same file (`displayer` on lines 1239/1241, where the call should likely be `name_displayer.display(...)` rather than a top-level `displayer` reference) are real-bug fixes and are deliberately left out of this surgical lint PR — they need a small behavioural review of their own. Verified via `ruff check --select=E9,F63,F7,F82 --no-fix --exclude='*.gpr.py' QuiltView/` (Surname F821 removed; the two unrelated `displayer` F821s remain) and `python3 -m py_compile`. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 02cf1ef commit dcc99a1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

QuiltView/QuiltView.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# Gramps Modules
5757
#
5858
#-------------------------------------------------------------------------
59-
from gramps.gen.lib import Person, Family, ChildRef, Name
59+
from gramps.gen.lib import Person, Family, ChildRef, Name, Surname
6060
from gramps.gui.views.navigationview import NavigationView
6161
from gramps.gen.display.name import displayer as name_displayer
6262
from gramps.gen.errors import WindowActiveError

0 commit comments

Comments
 (0)