Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
backends: Use staticfilesfor social auth logos.
Alex Vandiver63de6004516b
diff --git a/zproject/backends.py b/zproject/backends.pyindex 0a1d31ce5d1..a17da607716 100644--- a/zproject/backends.py+++ b/zproject/backends.py@@ -39,6 +39,7 @@ from decorator import decoratorfrom django.conf import settingsfrom django.contrib.auth import authenticate, get_backendsfrom django.contrib.auth.backends import RemoteUserBackend+from django.contrib.staticfiles.storage import staticfiles_storagefrom django.core.exceptions import ValidationErrorfrom django.core.validators import validate_emailfrom django.dispatch import Signal, receiver@@ -1851,7 +1852,7 @@ class GitHubAuthBackend(SocialAuthMixin, GithubOAuth2):name = "github"auth_backend_name = "GitHub"sort_order = 100- display_icon = "/static/images/authentication_backends/github-icon.png"+ display_icon = staticfiles_storage.url("images/authentication_backends/github-icon.png")def get_all_associated_email_objects(self, *args: Any, **kwargs: Any) -> List[Dict[str, Any]]:access_token = kwargs["response"]["access_token"]@@ -1946,7 +1947,7 @@ class AzureADAuthBackend(SocialAuthMixin, AzureADOAuth2):sort_order = 50name = "azuread-oauth2"auth_backend_name = "AzureAD"- display_icon = "/static/images/authentication_backends/azuread-icon.png"+ display_icon = staticfiles_storage.url("images/authentication_backends/azuread-icon.png")@external_auth_method@@ -1954,7 +1955,7 @@ class GitLabAuthBackend(SocialAuthMixin, GitLabOAuth2):sort_order = 75name = "gitlab"auth_backend_name = "GitLab"- display_icon = "/static/images/authentication_backends/gitlab-icon.png"+ display_icon = staticfiles_storage.url("images/authentication_backends/gitlab-icon.png")# Note: GitLab as of early 2020 supports having multiple email# addresses connected with a GitLab account, and we could access@@ -1970,7 +1971,7 @@ class GoogleAuthBackend(SocialAuthMixin, GoogleOAuth2):sort_order = 150auth_backend_name = "Google"name = "google"- display_icon = "/static/images/authentication_backends/googl_e-icon.png"+ display_icon = staticfiles_storage.url("images/authentication_backends/googl_e-icon.png")def get_verified_emails(self, *args: Any, **kwargs: Any) -> List[str]:verified_emails: List[str] = []@@ -2001,7 +2002,7 @@ class AppleAuthBackend(SocialAuthMixin, AppleIdAuth):sort_order = 10name = "apple"auth_backend_name = "Apple"- display_icon = "/static/images/authentication_backends/apple-icon.png"+ display_icon = staticfiles_storage.url("images/authentication_backends/apple-icon.png")# Apple only sends `name` in its response the first time a user# tries to sign up, so we won't have it in consecutive attempts.