Exemple #1
0
def remove_sample(request, md5):
    """
    Remove a sample from CRITs.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param md5: The MD5 of the sample to remove.
    :type md5: str
    :returns: :class:`django.http.HttpResponse`
    """

    result = delete_sample(md5, '%s' % request.user.username)
    if result:
        org = get_user_organization(request.user.username)
        return HttpResponseRedirect(reverse('crits-samples-views-samples_listing')
                                    +'?source=%s' % org)
    else:
        return render(request, 'error.html', {'error': "Could not delete sample"})
Exemple #2
0
def remove_sample(request, md5):
    """
    Remove a sample from CRITs.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param md5: The MD5 of the sample to remove.
    :type md5: str
    :returns: :class:`django.http.HttpResponse`
    """

    result = delete_sample(md5, '%s' % request.user.username)
    if result:
        org = get_user_organization(request.user.username)
        return HttpResponseRedirect(
            reverse('crits-samples-views-samples_listing') +
            '?source=%s' % org)
    else:
        return render(request, 'error.html',
                      {'error': "Could not delete sample"})