Example #1
0
def landing(request, urlname):
    conference = get_object_or_404(Conference, urlname=urlname)
    reg = get_object_or_404(ConferenceRegistration,
                            conference=conference,
                            attendee=request.user)

    if not reg.checkinprocessors_set.filter(pk=conference.pk).exists():
        raise PermissionDenied()

    link = "{0}/events/{1}/checkin/{2}/".format(settings.SITEBASE,
                                                conference.urlname,
                                                reg.regtoken)

    if request.method == 'POST' and request.POST.get('op') == 'sendmail':
        send_conference_mail(conference,
                             reg.email,
                             "Your check-in link",
                             "confreg/mail/checkin_link.txt", {
                                 'conference': conference,
                                 'reg': reg,
                                 'link': link,
                             },
                             receivername=reg.fullname)
        messages.info(request, "Link has been sent to {0}".format(reg.email))
        return HttpResponseRedirect(".")

    return render_conference_response(
        request, conference, 'reg', 'confreg/checkin_landing.html', {
            'reg': reg,
            'checkinlink': link,
            'qrlink': generate_base64_qr(link, 5, 200),
            'qrtest': generate_base64_qr("ID$TESTTESTTESTTEST$ID", 2, 150),
        })
Example #2
0
def testcode(request):
    return render(
        request, 'confsponsor/scanning_testcode.html', {
            'qrtest': generate_base64_qr("AT$TESTTESTTESTTEST$AT", 2, 150),
        })