Skip to content

Commit

Permalink
fix(socialaccount): provider.name must be a class level property
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Aug 19, 2023
1 parent 3d685a2 commit 6e0725b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions allauth/socialaccount/providers/openid_connect/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class OpenIDConnectProvider(OAuth2Provider):
name = "OpenID Connect"
account_class = OpenIDConnectProviderAccount

@property
def name(self):
return self.app.name
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.name = self.app.name

@property
def server_url(self):
Expand Down
7 changes: 4 additions & 3 deletions allauth/socialaccount/providers/saml/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def to_str(self):

class SAMLProvider(Provider):
id = "saml"
name = "SAML"
account_class = SAMLAccount
default_attribute_mapping = {
"uid": [
Expand All @@ -36,9 +37,9 @@ class SAMLProvider(Provider):
],
}

@property
def name(self):
return self.app.name or self.app.client_id or self.id
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.name = self.app.name or self.app.client_id or self.name

def get_login_url(self, request, **kwargs):
url = reverse("saml_login", kwargs={"organization_slug": self.app.client_id})
Expand Down

0 comments on commit 6e0725b

Please sign in to comment.