Skip to content

Commit 217d550

Browse files
committed
Fix regression in FieldListModel
1 parent 7432a81 commit 217d550

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

redistricting/gui/RdsFieldTableView.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
class FieldListModel(QAbstractTableModel):
7272

7373
_headings = [
74-
QCoreApplication.translate('Redistricting', 'Field'),
75-
QCoreApplication.translate('Redistricting', 'Caption'),
76-
QCoreApplication.translate('Redistricting', '∑'),
77-
QCoreApplication.translate('Redistricting', '%')
74+
tr('Redistricting', 'Field'),
75+
tr('Redistricting', 'Caption'),
76+
tr('Redistricting', '∑'),
77+
tr('Redistricting', '%')
7878
]
7979

8080
def __init__(self, fields: Union[FieldList, List[Field]] = None, popFields: Union[FieldList, list[Field]] = None, parent=None):
@@ -83,6 +83,8 @@ def __init__(self, fields: Union[FieldList, List[Field]] = None, popFields: Unio
8383
self._data: FieldList = fields[:]
8484
elif isinstance(fields, list) and all(isinstance(f, Field) for f in fields):
8585
self._data: FieldList = FieldList(fields)
86+
elif fields is None:
87+
self._data = FieldList()
8688
else:
8789
raise ValueError(tr("fields must be a FieldList or a list of Fields"))
8890

0 commit comments

Comments
 (0)