Skip to content
enrollment.py 35.4 KiB
Newer Older
                messages.add_message(request, messages.SUCCESS,
                        _("Changes saved."))
            elif "approve" in request.POST:
                send_enrollment_decision(participation, True, pctx.request)
                # FIXME: Double-saving
                participation = form.save()
                participation.status = participation_status.active
                participation.save()
                reset_form = True
                messages.add_message(request, messages.SUCCESS,
                        _("Successfully enrolled."))
            elif "deny" in request.POST:
                send_enrollment_decision(participation, False, pctx.request)
                # FIXME: Double-saving
                participation = form.save()
                participation.status = participation_status.denied
                participation.save()
                reset_form = True
                messages.add_message(request, messages.SUCCESS,
                        _("Successfully denied."))
            elif "drop" in request.POST:
                # FIXME: Double-saving
                participation = form.save()
                participation.status = participation_status.dropped
                participation.save()
                reset_form = True
                messages.add_message(request, messages.SUCCESS,
                        _("Successfully dropped."))
        if reset_form:
            form = EditParticipationForm(
                    add_new, pctx, instance=participation)
        form = EditParticipationForm(add_new, pctx, instance=participation)

    return render_course_page(pctx, "course/generic-course-form.html", {
        "form_description": _("Edit Participation"),
        "form": form
        })

# }}}

# vim: foldmethod=marker