Example #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)
Example #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)
Example #3
0
def booking_detail(request, pk):
    return views_template.obj_detail(request, pk, Booking, BookingSerializer)
Example #4
0
def email_template_detail(request, pk):
    return views_template.obj_detail(request, pk, EmailTemplate,
                                     EmailtemplateSerializer)
Example #5
0
def booked_item_detail(request, pk):
    return views_template.obj_detail(request, pk, BookedItem,
                                     BookedItemSerializer)
Example #6
0
def item_detail(request, pk):
    return views_template.obj_detail(request, pk, Item, ItemSerializer)
Example #7
0
def confirmation_template_detail(request, pk):
    return views_template.obj_detail(request, pk, ConfirmationEmail,
                                     ConfirmationEmailSerializer)