Skip to content

Commit

Permalink
Merge pull request #2051 from uktrade/disable-minor-edit-flow
Browse files Browse the repository at this point in the history
Disable minor edit flow
  • Loading branch information
kevincarrogan authored Jun 27, 2024
2 parents 8335948 + 0004740 commit 91e8a76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
14 changes: 2 additions & 12 deletions exporter/applications/forms/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,8 @@ def declaration_form(application_id):


class EditApplicationForm(forms.Form):
CHOICES = [
("minor", "Delete a product, third party or country"),
("major", "Add a product or edit something else"),
]
edit_type = forms.ChoiceField(
choices=CHOICES,
widget=forms.RadioSelect,
label="",
error_messages={
"required": "Please select an option to proceed.",
},
)
# The minor edit flow has been disabled,
# so all edits are major edits

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion exporter/applications/templates/edit_application_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% error_summary form %}

<h1 class="govuk-heading-l">How do you want to edit the application?</h1>
<h1 class="govuk-heading-l">Confirm that you want to edit the application</h1>
<p class="govuk-hint">
If you make changes, it will take longer to process your application.<br>
You cannot edit a product, only add a new one or remove an existing one.
Expand Down
7 changes: 3 additions & 4 deletions exporter/applications/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,11 @@ def handle_major_edit(self):
return redirect(reverse_lazy("applications:task_list", kwargs={"pk": self.application_id}))

def form_valid(self, form):

self.application_id = str(self.kwargs["pk"])
if form.cleaned_data.get("edit_type") == "major":
return self.handle_major_edit()

return HttpResponseRedirect(reverse_lazy("applications:task_list", kwargs={"pk": self.application_id}))
# The minor edit flow has been disabled,
# so all edits are major edits
return self.handle_major_edit()


class ApplicationTaskList(LoginRequiredMixin, TemplateView):
Expand Down

0 comments on commit 91e8a76

Please sign in to comment.