mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	webhooks: Ignore short_name to guess user.
The short_name field isn't super reliable, and we are about to eliminate it.
This commit is contained in:
		@@ -27,7 +27,6 @@ def guess_zulip_user_from_harbor(harbor_username: str, realm: Realm) -> Optional
 | 
			
		||||
        # and beginning of email address
 | 
			
		||||
        user = UserProfile.objects.filter(
 | 
			
		||||
            Q(full_name__iexact=harbor_username) |
 | 
			
		||||
            Q(short_name__iexact=harbor_username) |
 | 
			
		||||
            Q(email__istartswith=harbor_username),
 | 
			
		||||
            is_active=True,
 | 
			
		||||
            realm=realm).order_by("id")[0]
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,6 @@ def guess_zulip_user_from_jira(jira_username: str, realm: Realm) -> Optional[Use
 | 
			
		||||
        # and beginning of email address
 | 
			
		||||
        user = UserProfile.objects.filter(
 | 
			
		||||
            Q(full_name__iexact=jira_username) |
 | 
			
		||||
            Q(short_name__iexact=jira_username) |
 | 
			
		||||
            Q(email__istartswith=jira_username),
 | 
			
		||||
            is_active=True,
 | 
			
		||||
            realm=realm).order_by("id")[0]
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,6 @@ def guess_zulip_user_from_teamcity(teamcity_username: str, realm: Realm) -> Opti
 | 
			
		||||
        # and beginning of email address
 | 
			
		||||
        user = UserProfile.objects.filter(
 | 
			
		||||
            Q(full_name__iexact=teamcity_username) |
 | 
			
		||||
            Q(short_name__iexact=teamcity_username) |
 | 
			
		||||
            Q(email__istartswith=teamcity_username),
 | 
			
		||||
            is_active=True,
 | 
			
		||||
            realm=realm).order_by("id")[0]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user