Пример #1
0
def reward_point_redemption_event_create(request):
    event = RewardPointRedemptionEvent()
    form = RewardPointRedemptionEventForm(request.POST or None, instance=event)

    if form.is_valid():
        form.save()
        messages.success(request, _("Successfully created event."))
        return redirect('rewards:reward_point_redemption_events')
    else:
        return render(request, "rewards_reward_point_redemption_event_form.html", dict(form=form))
Пример #2
0
def reward_point_redemption_event_create(request):
    event = RewardPointRedemptionEvent()
    form = RewardPointRedemptionEventForm(request.POST or None, instance=event)

    if form.is_valid():
        form.save()
        messages.success(request, _("Successfully created event."))
        return redirect('evap.rewards.views.reward_point_redemption_events')
    else:
        return render_to_response("rewards_reward_point_redemption_event_form.html", dict(form=form), context_instance=RequestContext(request))
Пример #3
0
def reward_point_redemption_event_create(request):
    event = RewardPointRedemptionEvent()
    form = RewardPointRedemptionEventForm(request.POST or None, instance=event)

    if form.is_valid():
        form.save()
        messages.success(request, _("Successfully created event."))
        return redirect("rewards:reward_point_redemption_events")

    return render(request, "rewards_reward_point_redemption_event_form.html",
                  dict(form=form))
Пример #4
0
def reward_point_redemption_event_edit(request, event_id):
    event = get_object_or_404(RewardPointRedemptionEvent, id=event_id)
    form = RewardPointRedemptionEventForm(request.POST or None, instance=event)

    if form.is_valid():
        event = form.save()

        messages.success(request, _("Successfully updated event."))
        return redirect('rewards:reward_point_redemption_events')
    else:
        return render(request, "rewards_reward_point_redemption_event_form.html", dict(event=event, form=form))
Пример #5
0
def reward_point_redemption_event_edit(request, event_id):
    event = get_object_or_404(RewardPointRedemptionEvent, id=event_id)
    form = RewardPointRedemptionEventForm(request.POST or None, instance=event)

    if form.is_valid():
        event = form.save()

        messages.success(request, _("Successfully updated event."))
        return redirect("rewards:reward_point_redemption_events")

    return render(request, "rewards_reward_point_redemption_event_form.html",
                  dict(event=event, form=form))