Skip to content

Commit

Permalink
[Fixes #8420] Hide Connected social accounts link from profile if no …
Browse files Browse the repository at this point in the history
…social provider + app is configured (#8450)
  • Loading branch information
marthamareal authored Dec 2, 2021
1 parent 4df4f57 commit 9c5a6e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions geonode/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from geonode.notifications_helper import has_notifications
from geonode.base.models import Configuration, Thesaurus

from allauth.socialaccount.models import SocialApp


def resource_urls(request):
"""Global values to pass to templates"""
Expand Down Expand Up @@ -201,5 +203,6 @@ def resource_urls(request):
],
ADVANCED_EDIT_EXCLUDE_FIELD=getattr(settings, "ADVANCED_EDIT_EXCLUDE_FIELD", []),
PROFILE_EDIT_EXCLUDE_FIELD=getattr(settings, "PROFILE_EDIT_EXCLUDE_FIELD", []),
AVAILABLE_SOCIAL_APPS_COUNT=SocialApp.objects.count(),
)
return defaults
6 changes: 4 additions & 2 deletions geonode/people/templates/people/profile_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ <h3>{{ profile.first_name|default:profile.name_long }}</h3>
{% if not READ_ONLY_MODE %}
<li class="list-group-item"><a href="{% url "profile_edit" user.username %}"><i class="fa fa-edit"></i> {% trans "Edit profile" %}</a></li>
{% endif %}
<li class="list-group-item"><a href="{% url "socialaccount_connections" %}"><i class="fa fa-sign-in"></i> {% trans "Connected social accounts" %}</a></li>
<li class="list-group-item"><a href="{% url "account_email" %}"><i class="fa fa-envelope-o"></i> {% trans "Associated e-mails" %}</a></li>
{% if not AVAILABLE_SOCIAL_APPS_COUNT == 0 %}
<li class="list-group-item"><a href="{% url "socialaccount_connections" %}"><i class="fa fa-sign-in"></i> {% trans "Connected social accounts" %}</a></li>
{% endif %}
<li class="list-group-item"><a href="{% url "account_email" %}"><i class="fa fa-envelope-o"></i> {% trans "Associated e-mails" %}</a></li>
{% if not READ_ONLY_MODE %}
<li class="list-group-item"><a href="{% url "account_change_password" %}"><i class="fa fa-lock"></i> {% trans "Set/Change password" %}</a></li>
{% endif %}
Expand Down

0 comments on commit 9c5a6e8

Please sign in to comment.