Add missing transformation view message display

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-12-05 05:58:31 -04:00
parent 40bd1b297c
commit 4afdac2b00
2 changed files with 12 additions and 0 deletions

View File

@@ -5,6 +5,8 @@
- Don't exit GitLab makefile target if the branch to delete doesn't exist.
- Automatically create transformations from the selection form that
doesn't have arguments.
- Add missing message displays for transformation error creation and
not argument transformation creation.
3.3.2 (2019-12-05)
==================

View File

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
import logging
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.urls import reverse
@@ -57,6 +58,10 @@ class TransformationCreateView(
instance.save()
except Exception as exception:
logger.debug('Invalid form, exception: %s', exception)
messages.error(
message=_('Error creating transforamtion: %s.') % exception,
request=self.request
)
return super(TransformationCreateView, self).form_invalid(form)
else:
return super(TransformationCreateView, self).form_valid(form)
@@ -284,6 +289,11 @@ class TransformationSelectView(
name=form.cleaned_data['transformation']
)
messages.success(
message=_('Transformation created successfully.'),
request=self.request
)
return HttpResponseRedirect(
redirect_to=reverse(
viewname='converter:transformation_list', kwargs={