Esempio n. 1
0
def action_product_evaluation_request_approved(user):
    action = constants.ACTIVITY_ACTION_EVALUATION_REQUEST_APPROVED

    user.profile.update_marketo_score(action)

    models.UserActivity.track(user, action)
    
    skyhigh_product_api.create_evaluation_account(user)
Esempio n. 2
0
def action_product_evaluation_request_approved(user):
    action = constants.ACTIVITY_ACTION_EVALUATION_REQUEST_APPROVED

    user.profile.update_marketo_score(action)

    models.UserActivity.track(user, action)

    skyhigh_product_api.create_evaluation_account(user)
Esempio n. 3
0
    def get(self, request, *args, **kwargs):
        action = kwargs['action']
        user_id = kwargs['user_id']

        evaluation = skyhigh_models.ProductEvaluation.objects.get(user__pk=user_id)
        
        evaluation.modified_by = request.user

        if action == 'approve':
            evaluation.status = constants.PRODUCT_EVALUATION_STATUS_APPROVED
            evaluation.save()

            api_product.create_evaluation_account(evaluation.user)

        elif action == 'decline':
            evaluation.status = constants.PRODUCT_EVALUATION_STATUS_DECLINED
            evaluation.save()

        if request.is_ajax():
            return respond_with_json({'status': 'success'})

        return HttpResponseRedirect(request.META['HTTP_REFERER'])
Esempio n. 4
0
    def get(self, request, *args, **kwargs):
        action = kwargs['action']
        user_id = kwargs['user_id']

        evaluation = skyhigh_models.ProductEvaluation.objects.get(
            user__pk=user_id)

        evaluation.modified_by = request.user

        if action == 'approve':
            evaluation.status = constants.PRODUCT_EVALUATION_STATUS_APPROVED
            evaluation.save()

            api_product.create_evaluation_account(evaluation.user)

        elif action == 'decline':
            evaluation.status = constants.PRODUCT_EVALUATION_STATUS_DECLINED
            evaluation.save()

        if request.is_ajax():
            return respond_with_json({'status': 'success'})

        return HttpResponseRedirect(request.META['HTTP_REFERER'])