Fix bug where batch creator was being overwritten anytime it was viewed..

Yikes!  Hopefully this didn't happen too many times in production...
This commit is contained in:
Lance Edgar 2016-03-11 13:55:51 -06:00
parent cd461aef51
commit de58adad24

View file

@ -173,7 +173,7 @@ class BatchMasterView(MasterView):
fs.cognized_by.set(label="Cognized by", renderer=forms.renderers.UserFieldRenderer)
fs.executed_by.set(label="Executed by", renderer=forms.renderers.UserFieldRenderer)
if self.request.user:
if self.creating and self.request.user:
batch = fs.model
batch.created_by_uuid = self.request.user.uuid
@ -773,7 +773,7 @@ class BatchMasterView(MasterView):
config.add_view(cls, attr='execute', route_name='{}.execute'.format(route_prefix),
permission='{}.execute'.format(permission_prefix))
config.add_tailbone_permission(permission_prefix, '{}.execute'.format(permission_prefix),
"Execute {} batches".format(model_title))
"Execute {}".format(model_title))
# download rows as CSV
config.add_route('{}.csv'.format(route_prefix), '{}/{{uuid}}/csv'.format(url_prefix))