From c5aad692ffc1dc6d3c38fcb32ece1933be83be1c Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Tue, 25 Feb 2014 21:36:32 -0500 Subject: [PATCH] Show message when user does not have permission to access proposal submission page --- symposion/proposals/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/symposion/proposals/views.py b/symposion/proposals/views.py index cf532c2b..71b6a549 100644 --- a/symposion/proposals/views.py +++ b/symposion/proposals/views.py @@ -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 " + "log in 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 " + "create a speaker " + "profile.".format(url)) return redirect("dashboard") kinds = []