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):
# We want to progress as normal so don't redirect through form
return False
else:
# Add a helpful message to prompt them to select the correct option
messages.warning(
request,
_('A determination of "{current}" exists but you tried to progress as "{target}"').format(
current=determination.get_outcome_display(),
target=action,
if request:
# Add a helpful message to prompt them to select the correct option
messages.warning(
request,
_('A determination of "{current}" exists but you tried to progress as "{target}"').format(
current=determination.get_outcome_display(),
target=action,
)
)
)
if action in DETERMINATION_OUTCOMES:
return HttpResponseRedirect(reverse_lazy(
'apply:submissions:determinations:form',
args=(submission.id,)) + "?action=" + action)
args=(submission.id,)) + "?action=" + action
)
@method_decorator(staff_required, name='dispatch')
......
......@@ -24,7 +24,10 @@ class ActionSerializer(serializers.Field):
# determination matrix.
try:
redirect = DeterminationCreateOrUpdateView.should_redirect(
self.context['request'], instance, transition)
None,
instance,
transition,
)
except KeyError:
redirect = None
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