Skip to content

Commit

Permalink
Conditionally add allauth middleware
Browse files Browse the repository at this point in the history
Co-authored-by: Dan LaManna <[email protected]>
  • Loading branch information
mvandenburgh and danlamanna authored Sep 11, 2023
1 parent 24374a6 commit 121f802
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dandiapi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ def mutate_configuration(configuration: type[ComposedConfiguration]):

# TODO: remove this when the upstream fix is merged
# (https://github.com/girder/django-composed-configuration/pull/189)
configuration.MIDDLEWARE += [
'allauth.account.middleware.AccountMiddleware',
]
if 'allauth.account.middleware.AccountMiddleware' not in configuration.MIDDLEWARE:
configuration.MIDDLEWARE += [
'allauth.account.middleware.AccountMiddleware',
]

# Install guardian
configuration.INSTALLED_APPS += ['guardian']
Expand Down

0 comments on commit 121f802

Please sign in to comment.