def _remove_contacts(request, sp):
    for (key, value) in request.POST.dict().items():
        if (value == 'on'):
            contact = Contact.objects.get(pk=key)
            if (contact.sp == sp):
                contact.end_at = timezone.now()
                contact.save()
                sp.save_modified()
                logger.info('Contact removed from {sp} by {user}'.format(sp=sp, user=request.user))
                messages.add_message(request, messages.INFO, _('Contact removed.'))
def _remove_contacts(request, sp):
    for (key, value) in request.POST.dict().items():
        if (value == 'on'):
            contact = Contact.objects.get(pk=key)
            if (contact.sp == sp):
                contact.end_at = timezone.now()
                contact.save()
                sp.save_modified()
                logger.info('Contact removed from {sp} by {user}'.format(sp=sp, user=request.user))
                messages.add_message(request, messages.INFO, _('Contact removed.'))