Changeset - 41ba224759b8
[Not reviewed]
0 3 0
Christopher Neugebauer - 6 years ago 2017-10-02 23:29:40
Adds special login link for buy_tickets that displays an message
3 files changed with 14 insertions and 3 deletions:
0 comments (0 inline, 0 general)
Show inline comments
@@ -20,7 +20,7 @@

<br />

<div class="pull-right"><a class="btn btn-lg btn-primary" href="/dashboard">Buy a Ticket</a></div>
<div class="pull-right"><a class="btn btn-lg btn-primary" href="/tickets/buy">Buy a Ticket</a></div>
<h2>Which Ticket?</h2>

<p><em>Early Bird discounts are available for the first 100 tickets sold, or until October 20, whichever comes first. T-shirts are only available for tickets bought before November 7.</em></p>
@@ -101,7 +101,7 @@
<p>If you can’t afford to attend on these prices, please email <a href=""></a> – we’ll enthusiastically waive ticket fees for people who need it.</em></p>

<div class="btn-group">
  <a class="btn btn-lg btn-primary" href="/dashboard">Buy a Ticket</a>
  <a class="btn btn-lg btn-primary" href="/tickets/buy">Buy a Ticket</a>


Show inline comments
@@ -31,6 +31,7 @@ urlpatterns = [
    # attend
    url(r"^attend$", TemplateView.as_view(template_name="static_pages/attend/attend.html"), name="attend/attend"),
    url(r"^tickets$", RedirectView.as_view(url="attend")),
    url(r"^tickets/buy$", views.buy_ticket, name="buy_ticket"),
    url(r"^attend/business-case$", TemplateView.as_view(template_name="static_pages/attend/business-case.html"), name="attend/business-case"),
    url(r"^attend/travel$", TemplateView.as_view(template_name="static_pages/attend/travel.html"), name="attend/travel"),
    url(r"^attend/hotels$", TemplateView.as_view(template_name="static_pages/attend/hotels.html"), name="attend/hotels"),
Show inline comments
from django.conf import settings
from django.contrib import messages
from django.http import HttpResponseServerError
from django.shortcuts import render
from django.shortcuts import redirect, render
from django.template import RequestContext
from django.template import Template
from django.template.loader import get_template
@@ -28,3 +29,12 @@ def account_login(request):

class EmailLoginView(LoginView):
    form_class = LoginEmailForm


def buy_ticket(request):

    if not request.user.is_authenticated():
        messages.warning(request, 'To buy a ticket, either create an account, or log in.')

    return redirect("/dashboard")
0 comments (0 inline, 0 general)