Merge pull request #50 from pyohio/pyohio-messages-proposal-submit

User messages on proposal submit page
This commit is contained in:
Patrick Altman 2014-07-31 23:34:54 -05:00
commit 819616ce0c

View file

@ -3,6 +3,7 @@ import sys
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.shortcuts import render, redirect, get_object_or_404
@ -31,11 +32,18 @@ def get_form(name):
def proposal_submit(request):
if not request.user.is_authenticated():
messages.info(request, "To submit a proposal, please "
"<a href='{0}'>log in</a> and create a speaker profile "
"via the dashboard.".format(settings.LOGIN_URL))
return redirect("home") # @@@ unauth'd speaker info page?
else:
try:
request.user.speaker_profile
except ObjectDoesNotExist:
url = reverse("speaker_create")
messages.info(request, "To submit a proposal, first "
"<a href='{0}'>create a speaker "
"profile</a>.".format(url))
return redirect("dashboard")
kinds = []