Skip to content

Commit 61648cd

Browse files
authored
Add user_has_github_app_account templatetag (#12310)
ref readthedocs/ext-theme#631
1 parent cfbdde4 commit 61648cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

readthedocs/core/templatetags/readthedocs/socialaccounts.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ def has_github_app_account(account):
4141
provider=GitHubAppProvider.id,
4242
uid=account.uid,
4343
).exists()
44+
45+
46+
@register.filter
47+
def user_has_github_app_account(user):
48+
"""Check if a user has a GitHub App account."""
49+
return user.socialaccount_set.filter(provider=GitHubAppProvider.id).exists()

0 commit comments

Comments
 (0)