Add a new member workshift profile, for people who join mid-semester.

def add_workshifter_view(request, semester):
    """
    Add a new member workshift profile, for people who join mid-semester.
    """
    page_name = "Add Workshifter"

    existing = [
        i.user.pk for i in WorkshiftProfile.objects.filter(semester=semester)
    ]
    users = User.objects.exclude(
        Q(pk__in=existing) |
        Q(is_active=False) |
        Q(userprofile__status=UserProfile.ALUMNUS)
    )

    add_workshifter_forms = []
    for user in users:
        form = AddWorkshifterForm(
            data=request.POST or None,
            prefix="user-{}".format(user.pk),
            user=user,
            semester=semester,
        )
        add_workshifter_forms.append(form)

    if add_workshifter_forms and \
       all(form.is_valid() for form in add_workshifter_forms):
        for form in add_workshifter_forms:
            form.save()
        messages.add_message(
            request,
            messages.INFO,
            "Workshifters added.",
        )
        return HttpResponseRedirect(wurl(
            "workshift:manage",
            sem_url=semester.sem_url,
        ))

    return render_to_response("add_workshifter.html", {
        "page_name": page_name,
        "add_workshifter_forms": add_workshifter_forms,
    }, context_instance=RequestContext(request))