Skip to content

Commit

Permalink
fix(staging): don't check email while in staging env
Browse files Browse the repository at this point in the history
  • Loading branch information
esinx committed Sep 22, 2024
1 parent cd63fc4 commit e262c57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/accounts/backends.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import requests
from django.conf import settings
from django.contrib.auth import get_user_model
Expand All @@ -7,6 +8,8 @@

from accounts.models import Email

SETTINGS_MODULE = os.getenv("DJANGO_SETTINGS_MODULE", None)


class ShibbolethRemoteUserBackend(RemoteUserBackend):
"""
Expand All @@ -15,7 +18,8 @@ class ShibbolethRemoteUserBackend(RemoteUserBackend):
"""

def get_email(self, pennid):
if settings.DEBUG:
# Skip if in debug mode or staging
if settings.DEBUG or SETTINGS_MODULE == "Platform.settings.staging":
return None
"""
Use Penn Directory API with OAuth2 to get the email of a user given their Penn ID.
Expand Down

0 comments on commit e262c57

Please sign in to comment.