Esempio n. 1
0
def booking_detail_token(request, token):
    try:
        booking_id = decode_token(token)
    except Exception:
        return JsonResponse({"message": "Invalid token"},
                            status=status.HTTP_403_FORBIDDEN)
    return views_template.obj_detail(request, booking_id, Booking,
                                     BookingSerializer)
Esempio n. 2
0
def email_template_detail_populated(request, pk, booking_pk):
    response = views_template.obj_detail(request, pk, EmailTemplate,
                                         EmailtemplateSerializer)
    if response.status_code != status.HTTP_200_OK:
        return response
    else:
        data = json.loads(response.content.decode('utf-8'))
        data["template"] = populate_template(data["template"], booking_pk)
        return JsonResponse(data=data, status=status.HTTP_200_OK)
Esempio n. 3
0
def booking_detail(request, pk):
    return views_template.obj_detail(request, pk, Booking, BookingSerializer)
Esempio n. 4
0
def email_template_detail(request, pk):
    return views_template.obj_detail(request, pk, EmailTemplate,
                                     EmailtemplateSerializer)
Esempio n. 5
0
def booked_item_detail(request, pk):
    return views_template.obj_detail(request, pk, BookedItem,
                                     BookedItemSerializer)
Esempio n. 6
0
def item_detail(request, pk):
    return views_template.obj_detail(request, pk, Item, ItemSerializer)
Esempio n. 7
0
def confirmation_template_detail(request, pk):
    return views_template.obj_detail(request, pk, ConfirmationEmail,
                                     ConfirmationEmailSerializer)