Skip to content
Snippets Groups Projects
Commit 47a7946d authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Make sure the status check doesn't send a scary message when not submitting

parent faad381d
No related branches found
No related tags found
No related merge requests found
...@@ -262,19 +262,21 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView): ...@@ -262,19 +262,21 @@ class DeterminationCreateOrUpdateView(CreateOrUpdateView):
# We want to progress as normal so don't redirect through form # We want to progress as normal so don't redirect through form
return False return False
else: else:
# Add a helpful message to prompt them to select the correct option if request:
messages.warning( # Add a helpful message to prompt them to select the correct option
request, messages.warning(
_('A determination of "{current}" exists but you tried to progress as "{target}"').format( request,
current=determination.get_outcome_display(), _('A determination of "{current}" exists but you tried to progress as "{target}"').format(
target=action, current=determination.get_outcome_display(),
target=action,
)
) )
)
if action in DETERMINATION_OUTCOMES: if action in DETERMINATION_OUTCOMES:
return HttpResponseRedirect(reverse_lazy( return HttpResponseRedirect(reverse_lazy(
'apply:submissions:determinations:form', 'apply:submissions:determinations:form',
args=(submission.id,)) + "?action=" + action) args=(submission.id,)) + "?action=" + action
)
@method_decorator(staff_required, name='dispatch') @method_decorator(staff_required, name='dispatch')
......
...@@ -24,7 +24,10 @@ class ActionSerializer(serializers.Field): ...@@ -24,7 +24,10 @@ class ActionSerializer(serializers.Field):
# determination matrix. # determination matrix.
try: try:
redirect = DeterminationCreateOrUpdateView.should_redirect( redirect = DeterminationCreateOrUpdateView.should_redirect(
self.context['request'], instance, transition) None,
instance,
transition,
)
except KeyError: except KeyError:
redirect = None redirect = None
if redirect: if redirect:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment