Include action type on message

This commit is contained in:
Santiago L 2022-02-08 11:39:27 +01:00
parent aeb765dcd7
commit f1a78e23f6
1 changed files with 4 additions and 5 deletions

View File

@ -301,10 +301,8 @@ class NewActionView(View):
next_url = url_for('inventory.devices.lotdevicelist', lot_id=lot_id)
if self.form.validate_on_submit():
self.form.save()
# TODO(@slamora): include details of created action
messages.success('Action created!')
instance = self.form.save()
messages.success('Action "{}" created successfully!'.format(instance.type))
return flask.redirect(next_url)
@ -321,7 +319,8 @@ class NewAllocateView(NewActionView, DeviceListMix):
next_url = url_for('inventory.devices.lotdevicelist', lot_id=lot_id)
if self.form.validate_on_submit():
self.form.save()
instance = self.form.save()
messages.success('Action "{}" created successfully!'.format(instance.type))
return flask.redirect(next_url)
self.get_context(lot_id)