<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def request_announcement_view(request):
 """The request announcement page."""

    if request.method == "POST":
        form = AnnouncementRequestForm(request.POST)
        logger.debug(form)
        logger.debug(form.data)

        if form.is_valid():
            teacher_objs = form.cleaned_data["teachers_requested"]
            logger.debug("teacher objs:")
            logger.debug(teacher_objs)

            if len(teacher_objs) > 2:
                messages.error(request, "Please select a maximum of 2 teachers to approve this post.")
            else:
                obj = form.save(commit=True)
                obj.user = request.user
                # SAFE HTML
                obj.content = safe_html(obj.content)

                obj.save()

                ann = AnnouncementRequest.objects.get(id=obj.id)
                logger.debug(teacher_objs)
                approve_self = False
                for teacher in teacher_objs:
                    ann.teachers_requested.add(teacher)
                    if teacher == request.user:
                        approve_self = True
                ann.save()

                if approve_self:
                    ann.teachers_approved.add(teacher)
                    ann.save()
                    if settings.SEND_ANNOUNCEMENT_APPROVAL:
                        admin_request_announcement_email(request, form, ann)
                    ann.admin_email_sent = True
                    ann.save()
                    return redirect("request_announcement_success_self")

                else:
                    if settings.SEND_ANNOUNCEMENT_APPROVAL:
                        request_announcement_email(request, form, obj)
                    return redirect("request_announcement_success")
                return redirect("index")
        else:
            messages.error(request, "Error adding announcement request")
    else:
        form = AnnouncementRequestForm()
    return render(request, "announcements/request.html", {"form": form, "action": "add"})