Skip to content

Commit

Permalink
Mitigate some allauth bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tysen committed Jun 6, 2021
1 parent 15115a7 commit 60fc249
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
11 changes: 11 additions & 0 deletions daiquiri/core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from allauth.account.apps import AccountConfig
from allauth.socialaccount.apps import SocialAccountConfig

# See https://github.com/pennersr/django-allauth/issues/2826

class ModifiedAccountConfig(AccountConfig):
default_auto_field = 'django.db.models.AutoField'

class ModifiedSocialAccountConfig(SocialAccountConfig):
default_auto_field = 'django.db.models.AutoField'

11 changes: 9 additions & 2 deletions daiquiri/core/settings/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,18 @@
'compressor',
'widget_tweaks',
'allauth',
'allauth.account',
'allauth.socialaccount',
# Replaced with the two below to fix https://github.com/pennersr/django-allauth/issues/2826
# 'allauth.account',
# 'allauth.socialaccount',
'daiquiri.core.apps.ModifiedAccountConfig',
'daiquiri.core.apps.ModifiedSocialAccountConfig',
'rules'
]

# To fix https://github.com/pennersr/django-allauth/issues/2853
import allauth.app_settings
allauth.app_settings.SOCIALACCOUNT_ENABLED = True

MIDDLEWARE = [
'daiquiri.core.middleware.MultipleProxyMiddleware',
'django.middleware.security.SecurityMiddleware',
Expand Down
1 change: 1 addition & 0 deletions daiquiri/metadata/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class MetadataConfig(AppConfig):
name = 'daiquiri.metadata'
label = 'daiquiri_metadata'
verbose_name = 'Metadata'
default_auto_field = 'django.db.models.AutoField'

def ready(self):
from . import handlers
1 change: 1 addition & 0 deletions daiquiri/tap/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class TapConfig(AppConfig):
name = 'daiquiri.tap'
label = 'daiquiri_tap'
verbose_name = 'Tap'
default_auto_field = 'django.db.models.AutoField'

def ready(self):
from . import handlers

0 comments on commit 60fc249

Please sign in to comment.