Skip to content

Commit

Permalink
edit_certification: remove unused form processing logic.
Browse files Browse the repository at this point in the history
The page at /settings/certification/ does not contain any forms.  As
far as I can tell, there are no forms on the site that post to
/settings/certification/.  (The place where people actually submit
training applications is /settings/training/, which posts to
/settings/training/.)

The POST-handling code here was apparently copied and pasted from
edit_training and has no purpose.
  • Loading branch information
Benjamin Moody committed Apr 24, 2024
1 parent 78af23d commit bfe1ebf
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 bfe1ebf

Please sign in to comment.