Set test cookie even if cookies are disabled
It doesn't hurt anything, but we've hit this during development a bunch.
This commit is contained in:
		
							parent
							
								
									f7938a9dc1
								
							
						
					
					
						commit
						5435ed5789
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		
							
								
								
									
										4
									
								
								views.py
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								views.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -23,6 +23,10 @@ def login(request):
 | 
			
		|||
        request.session.delete_test_cookie()
 | 
			
		||||
        return redirect('/login/github/')
 | 
			
		||||
    else:
 | 
			
		||||
        # During development, I've landed here a lot, despite having cookies
 | 
			
		||||
        # enabled. So, set the test cookie so that trying to login from here
 | 
			
		||||
        # actually works.
 | 
			
		||||
        request.session.set_test_cookie()
 | 
			
		||||
        # Render an error -- fix your damn cookies!
 | 
			
		||||
        return render_to_response('login.html',
 | 
			
		||||
                                  { 'error': "Fix your damn cookies!" })
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue