@permission_required("core.manage_shop")
def save_discount_data(request, id):
    discount = Discount.objects.get(pk=id)
    discount_form = DiscountForm(instance=discount, data=request.POST)

    if discount_form.is_valid():
        discount_form.save()

    return lfs.core.utils.set_message_cookie(
        url=reverse("lfs_manage_discount", kwargs={"id": id}),
        msg=_(u"Discount data has been saved."),
    )
Saves discount data (via request body) to the discount with passed
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/discounts/views.py/save_discount_data