Require login for proposal submit
- This has the effect of bouncing people to the login page if they're unauthenticated, rather than returning a 502 because 'home' doesn't exist. - If they're authenticated but don't have a speaker profile, send them to the speaker profile create page rather than just to the dashboard. Closes #26
This commit is contained in:
		
							parent
							
								
									bb42d098fd
								
							
						
					
					
						commit
						6bf3d71bff
					
				
					 1 changed files with 5 additions and 8 deletions
				
			
		
							
								
								
									
										13
									
								
								vendor/symposion/proposals/views.py
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/symposion/proposals/views.py
									
										
									
									
										vendored
									
									
								
							|  | @ -60,18 +60,15 @@ def proposal_submit(request): | |||
|         "kinds": kinds, | ||||
|     }) | ||||
| 
 | ||||
| 
 | ||||
| @login_required | ||||
| def proposal_submit_kind(request, kind_slug): | ||||
| 
 | ||||
|     kind = get_object_or_404(ProposalKind, slug=kind_slug) | ||||
| 
 | ||||
|     if not request.user.is_authenticated(): | ||||
|         return redirect("home")  # @@@ unauth'd speaker info page? | ||||
|     else: | ||||
|         try: | ||||
|             speaker_profile = request.user.speaker_profile | ||||
|         except ObjectDoesNotExist: | ||||
|             return redirect("dashboard") | ||||
|     try: | ||||
|         speaker_profile = request.user.speaker_profile | ||||
|     except ObjectDoesNotExist: | ||||
|         return redirect("speaker_create") | ||||
| 
 | ||||
|     if not kind.section.proposalsection.is_available(): | ||||
|         return redirect("proposal_submit") | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 James Polley
						James Polley