538a32457740b46992ebc648f0e2aa54b7a4009a,external_api/api.py,,transfer_entities,#Any#,51

Before Change


    status, error = datastore_object.transfer_entities(entity_list=entity_list)
    result = {"status": status, "error": error}
    if not status:
        HttpResponse(json.dumps({"data": result}), content_type="application/json", status=500)
    return HttpResponse(json.dumps({"data": result}), content_type="application/json", status=200)

After Change


        HttpResponse : HttpResponse with appropriate status.
    
    response = {"success": False, "error": ""}
    try:
        entity_list_dict = json.loads(request.GET.get("word_info"))
        entity_list = entity_list_dict.get("entity_list")

        datastore_object = DataStore()
        datastore_object.transfer_entities(entity_list=entity_list)
        response["success"] = True
    except (ValueError, IndexNotFoundException, InvalidESURLException,
            SourceDestinationSimilarException, InternalBackupException, AliasNotFoundException,
            PointIndexToAliasException, FetchIndexForAliasException, DeleteIndexFromAliasException,
            AliasForTransferException, IndexForTransferException) as error_message:
        response["error"] = error_message
        return HttpResponse(json.dumps(response), content_type="application/json", status=500)
    except BaseException:
        response["error"] = "Base exception occured"
        return HttpResponse(json.dumps(response), content_type="application/json", status=500)

    return HttpResponse(json.dumps(response), content_type="application/json", status=200)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: hellohaptik/chatbot_ner
Commit Name: 538a32457740b46992ebc648f0e2aa54b7a4009a
Time: 2018-08-20
Author: pratik.jayarao@haptik.co
File Name: external_api/api.py
Class Name:
Method Name: transfer_entities


Project Name: hellohaptik/chatbot_ner
Commit Name: 04204114ace57fc1cca268c55b3ffa5ddd363ce6
Time: 2018-08-19
Author: pratik.jayarao@haptik.co
File Name: external_api/api.py
Class Name:
Method Name: transfer_entities


Project Name: hellohaptik/chatbot_ner
Commit Name: 04204114ace57fc1cca268c55b3ffa5ddd363ce6
Time: 2018-08-19
Author: pratik.jayarao@haptik.co
File Name: external_api/api.py
Class Name:
Method Name: update_dictionary