mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	models: Remove unused receives_stream_notifications function.
				
					
				
			This was introduced in c3a8138f74, but
doesn't have any callers, apart from it's own tests.
			
			
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							518deb7b9e
						
					
				
				
					commit
					3990b183ce
				
			@@ -1665,10 +1665,6 @@ def receives_online_push_notifications(user_profile: UserProfile) -> bool:
 | 
				
			|||||||
    return user_profile.enable_online_push_notifications and not user_profile.is_bot
 | 
					    return user_profile.enable_online_push_notifications and not user_profile.is_bot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def receives_stream_notifications(user_profile: UserProfile) -> bool:
 | 
					 | 
				
			||||||
    return user_profile.enable_stream_push_notifications and not user_profile.is_bot
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def remote_user_to_email(remote_user: str) -> str:
 | 
					def remote_user_to_email(remote_user: str) -> str:
 | 
				
			||||||
    if settings.SSO_APPEND_DOMAIN is not None:
 | 
					    if settings.SSO_APPEND_DOMAIN is not None:
 | 
				
			||||||
        remote_user += "@" + settings.SSO_APPEND_DOMAIN
 | 
					        remote_user += "@" + settings.SSO_APPEND_DOMAIN
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,7 +73,6 @@ from zerver.models import (
 | 
				
			|||||||
    receives_offline_email_notifications,
 | 
					    receives_offline_email_notifications,
 | 
				
			||||||
    receives_offline_push_notifications,
 | 
					    receives_offline_push_notifications,
 | 
				
			||||||
    receives_online_push_notifications,
 | 
					    receives_online_push_notifications,
 | 
				
			||||||
    receives_stream_notifications,
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if settings.ZILENCER_ENABLED:
 | 
					if settings.ZILENCER_ENABLED:
 | 
				
			||||||
@@ -2257,24 +2256,6 @@ class TestReceivesNotificationsFunctions(ZulipTestCase):
 | 
				
			|||||||
        self.assertTrue(receives_offline_push_notifications(self.user))
 | 
					        self.assertTrue(receives_offline_push_notifications(self.user))
 | 
				
			||||||
        self.assertFalse(receives_offline_email_notifications(self.user))
 | 
					        self.assertFalse(receives_offline_email_notifications(self.user))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_receivers_stream_notifications_when_user_is_a_bot(self) -> None:
 | 
					 | 
				
			||||||
        self.user.is_bot = True
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        self.user.enable_stream_push_notifications = True
 | 
					 | 
				
			||||||
        self.assertFalse(receives_stream_notifications(self.user))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        self.user.enable_stream_push_notifications = False
 | 
					 | 
				
			||||||
        self.assertFalse(receives_stream_notifications(self.user))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def test_receivers_stream_notifications_when_user_is_not_a_bot(self) -> None:
 | 
					 | 
				
			||||||
        self.user.is_bot = False
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        self.user.enable_stream_push_notifications = True
 | 
					 | 
				
			||||||
        self.assertTrue(receives_stream_notifications(self.user))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        self.user.enable_stream_push_notifications = False
 | 
					 | 
				
			||||||
        self.assertFalse(receives_stream_notifications(self.user))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestPushNotificationsContent(ZulipTestCase):
 | 
					class TestPushNotificationsContent(ZulipTestCase):
 | 
				
			||||||
    def test_fixtures(self) -> None:
 | 
					    def test_fixtures(self) -> None:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user