"""
 * @author Xiaobo Sun
 * created  on 23.05.2019
 * @copyright (C) 2019 Sogood International GmbH - all rights reserved
 * @licence
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
"""

from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from cdiscount import cdiscount


@csrf_exempt
def offers(request):
    """
    Django View : endpoint
    :param request: httpRequest
    :rtype: HttpResponse
    """
    items = request.POST.get("offers")
    path = cdiscount.do(items)
    return HttpResponse("%s" % path)
