diff --git a/symposion/speakers/views.py b/symposion/speakers/views.py index a0069c10..b087aa5a 100644 --- a/symposion/speakers/views.py +++ b/symposion/speakers/views.py @@ -71,29 +71,26 @@ def speaker_create_staff(request, pk): }) +@login_required def speaker_create_token(request, token): speaker = get_object_or_404(Speaker, invite_token=token) request.session["pending-token"] = token - if request.user.is_authenticated(): - # check for speaker profile - try: - existing_speaker = request.user.speaker_profile - except ObjectDoesNotExist: - pass - else: - del request.session["pending-token"] - additional_speakers = ProposalBase.additional_speakers.through - additional_speakers._default_manager.filter( - speaker=speaker - ).update( - speaker=existing_speaker - ) - messages.info(request, _("You have been associated with all pending " - "talk proposals")) - return redirect("dashboard") + # check for speaker profile + try: + existing_speaker = request.user.speaker_profile + except ObjectDoesNotExist: + pass else: - if not request.user.is_authenticated(): - return redirect("account_login") + del request.session["pending-token"] + additional_speakers = ProposalBase.additional_speakers.through + additional_speakers._default_manager.filter( + speaker=speaker + ).update( + speaker=existing_speaker + ) + messages.info(request, _("You have been associated with all pending " + "talk proposals")) + return redirect("dashboard") return redirect("speaker_create")