Pass form along to before_create_flush() in master3

This commit is contained in:
Lance Edgar 2017-09-23 16:26:56 -05:00
parent e283288a26
commit 8a945f8baf
2 changed files with 3 additions and 3 deletions

View file

@ -155,12 +155,12 @@ class MasterView3(MasterView2):
def save_create_form(self, form):
self.before_create(form)
obj = form.schema.objectify(self.form_deserialized)
self.before_create_flush(obj)
self.before_create_flush(obj, form)
self.Session.add(obj)
self.Session.flush()
return obj
def before_create_flush(self, obj):
def before_create_flush(self, obj, form):
pass
def save_edit_form(self, form):

View file

@ -303,7 +303,7 @@ class UpgradeView(MasterView):
def download_content_type(self, path, filename):
return 'text/plain'
def before_create_flush(self, upgrade):
def before_create_flush(self, upgrade, form):
upgrade.created_by = self.request.user
upgrade.status_code = self.enum.UPGRADE_STATUS_PENDING