From f1a78e23f6f1f91a8e0bccf9d72314a053519e9d Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Tue, 8 Feb 2022 11:39:27 +0100 Subject: [PATCH] Include action type on message --- ereuse_devicehub/inventory/views.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 3f6640aa..2ae1c9c4 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -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)