Skip to content

Commit 7147ad4

Browse files
committed
Pass dbstate, rather thandb, into populate_model
1 parent b6627b8 commit 7147ad4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Form/UK1841.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def __init__(self):
5454
ActionBase.__init__(self)
5555
pass
5656

57-
def populate_model(self, db, citation, form_event, model):
57+
def populate_model(self, dbstate, citation, form_event, model):
58+
db = dbstate.db
5859
parent = model.append(None, (_("Add Primary Name citation"), None, None))
5960
for item in db.find_backlink_handles(form_event.get_handle(),
6061
include_classes=['Person']):
@@ -79,7 +80,8 @@ def __init__(self):
7980
ActionBase.__init__(self)
8081
pass
8182

82-
def populate_model(self, db, citation, form_event, model):
83+
def populate_model(self, dbstate, citation, form_event, model):
84+
db = dbstate.db
8385
# if there is no date on the form, no actions can be performed
8486
if form_event.get_date_object():
8587
parent = model.append(None, (_("Add Birth event"), None, None))
@@ -117,7 +119,8 @@ def __init__(self):
117119
ActionBase.__init__(self)
118120
pass
119121

120-
def populate_model(self, db, citation, form_event, model):
122+
def populate_model(self, dbstate, citation, form_event, model):
123+
db = dbstate.db
121124
parent = model.append(None, (_("Add Occupation event"), None, None))
122125
for item in db.find_backlink_handles(form_event.get_handle(),
123126
include_classes=['Person']):

Form/formactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _populate_model(self):
149149

150150
for action_class in action_classes:
151151
action = (action_class[1])()
152-
action.populate_model(self.db, self.citation, self.event, self.model)
152+
action.populate_model(self.dbstate, self.citation, self.event, self.model)
153153

154154
def run(self):
155155
"""

0 commit comments

Comments
 (0)