-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(socialaccount): SOCIALACCOUNT_ONLY vs EMAIL_VERIFICATION
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.core.checks import Critical, register | ||
|
||
|
||
@register() | ||
def settings_check(app_configs, **kwargs): | ||
from allauth import app_settings as allauth_settings | ||
from allauth.account import app_settings as account_settings | ||
from allauth.socialaccount import app_settings | ||
|
||
ret = [] | ||
if allauth_settings.SOCIALACCOUNT_ONLY: | ||
if ( | ||
app_settings.EMAIL_VERIFICATION | ||
!= account_settings.EmailVerificationMethod.NONE | ||
): | ||
ret.append( | ||
Critical( | ||
msg="SOCIALACCOUNT_ONLY requires SOCIALACCOUNT_EMAIL_VERIFICATION = 'none'" | ||
) | ||
) | ||
return ret |