Skip to content

Commit

Permalink
Merge e64893e into 603aeff
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Feb 7, 2020
2 parents 603aeff + e64893e commit 0c35894
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
10 changes: 8 additions & 2 deletions rdmo/accounts/adapter.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from django.conf import settings

from allauth.account.adapter import DefaultAccountAdapter
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from django.conf import settings


class AccountAdapter(DefaultAccountAdapter):

def is_open_for_signup(self, request):
return settings.ACCOUNT_SIGNUP


class SocialAccountAdapter(DefaultSocialAccountAdapter):

def is_open_for_signup(self, request, sociallogin):
return settings.SOCIALACCOUNT_SIGNUP
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% if provider.id != 'orcid' %}
<span class="fa fa-{{provider.id}} fa-2x"></span>
{% else %}
<span class="socialaccount_provider_name">{{ provider.name }}</span>
<img class="orcid-signin" src="{% static 'accounts/img/orcid-signin.png' %}" alt="ORCID sign in" />
{% endif %}
</a>
</li>
Expand Down
6 changes: 6 additions & 0 deletions rdmo/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
ACCOUNT_PASSWORD_MIN_LENGTH = 4
ACCOUNT_EMAIL_MAX_LENGTH = 190

ACCOUNT_ADAPTER = 'rdmo.accounts.adapter.AccountAdapter'

SOCIALACCOUNT_ADAPTER = 'rdmo.accounts.adapter.SocialAccountAdapter'
SOCIALACCOUNT_SIGNUP = False
SOCIALACCOUNT_AUTO_SIGNUP = False

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Europe/Berlin'
Expand Down
5 changes: 5 additions & 0 deletions rdmo/core/static/core/css/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,8 @@ li.has-warning > a.control-label > i {
.select2-results__option--highlighted{
background-color: $link-color !important,
}

.orcid-signin {
display: block;
margin-bottom: 10px;
}

0 comments on commit 0c35894

Please sign in to comment.