Skip to content

Commit

Permalink
Remove unused form processing junk (#2226)
Browse files Browse the repository at this point in the history
Remove some useless junk code that somebody copied and pasted without
thinking.

The "edit_certifications" page is not the place where you submit
training applications. That's the "edit_trainings" page.

(related to issue #2220)
  • Loading branch information
tompollard authored Apr 26, 2024
2 parents 1cc27e2 + bfe1ebf commit 092932b
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions physionet-django/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,31 +795,6 @@ def edit_certification(request):
"""
Certifications page.
"""

if request.method == "POST":
training_form = forms.TrainingForm(
user=request.user,
data=request.POST,
files=request.FILES,
training_type=request.POST.get("training_type"),
)
if training_form.is_valid():
training_form.save()
messages.success(request, "The training has been submitted successfully.")
training_application_request(request, training_form)
training_form = forms.TrainingForm(user=request.user)
else:
messages.error(request, "Invalid submission. Check the errors below.")

else:
training_type = request.GET.get("trainingType")
if training_type:
training_form = forms.TrainingForm(
user=request.user, training_type=training_type
)
else:
training_form = forms.TrainingForm(user=request.user)

training = (
Training.objects.select_related("training_type")
.filter(user=request.user)
Expand Down

0 comments on commit 092932b

Please sign in to comment.