mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	@@ -312,7 +312,9 @@ class LoginTest(ZulipTestCase):
 | 
				
			|||||||
        self.assertIsNone(get_session_dict_user(self.client.session))
 | 
					        self.assertIsNone(get_session_dict_user(self.client.session))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_login_bad_password(self) -> None:
 | 
					    def test_login_bad_password(self) -> None:
 | 
				
			||||||
        self.login(self.example_email("hamlet"), password="wrongpassword", fails=True)
 | 
					        email = self.example_email("hamlet")
 | 
				
			||||||
 | 
					        result = self.login_with_return(email, password="wrongpassword")
 | 
				
			||||||
 | 
					        self.assert_in_success_response([email], result)
 | 
				
			||||||
        self.assertIsNone(get_session_dict_user(self.client.session))
 | 
					        self.assertIsNone(get_session_dict_user(self.client.session))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_login_nonexist_user(self) -> None:
 | 
					    def test_login_nonexist_user(self) -> None:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -545,6 +545,9 @@ def login_page(request: HttpRequest, **kwargs: Any) -> HttpResponse:
 | 
				
			|||||||
            # only if it actually exists.
 | 
					            # only if it actually exists.
 | 
				
			||||||
            return HttpResponseRedirect(realm.uri)
 | 
					            return HttpResponseRedirect(realm.uri)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if 'username' in request.POST:
 | 
				
			||||||
 | 
					        extra_context['email'] = request.POST['username']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        template_response = django_login_page(
 | 
					        template_response = django_login_page(
 | 
				
			||||||
            request, authentication_form=OurAuthenticationForm,
 | 
					            request, authentication_form=OurAuthenticationForm,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user