Skip to content

Commit

Permalink
chore(black)
Browse files Browse the repository at this point in the history
  • Loading branch information
esinx committed Sep 1, 2024
1 parent 374d5af commit 39331a8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
9 changes: 3 additions & 6 deletions backend/Platform/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

urlpatterns = [
path("admin/", admin.site.urls),
path("announcements/", include("announcements.urls",
namespace="announcements")),
path("announcements/", include("announcements.urls", namespace="announcements")),
path("accounts/", include("accounts.urls", namespace="oauth2_provider")),
path("options/", include("options.urls", namespace="options")),
path("identity/", include("identity.urls", namespace="identity")),
Expand All @@ -23,8 +22,7 @@
path(
"documentation/",
TemplateView.as_view(
template_name="redoc.html",
extra_context={"schema_url": "openapi-schema"}
template_name="redoc.html", extra_context={"schema_url": "openapi-schema"}
),
name="documentation",
),
Expand All @@ -35,6 +33,5 @@

urlpatterns = [
path("__debug__/", include(debug_toolbar.urls)),
path("emailpreview/", include("email_tools.urls",
namespace="email_tools")),
path("emailpreview/", include("email_tools.urls", namespace="email_tools")),
] + urlpatterns
17 changes: 10 additions & 7 deletions backend/accounts/oauth2_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@

class LabsOAuth2Validator(OAuth2Validator):
oidc_claim_scope = OAuth2Validator.oidc_claim_scope
oidc_claim_scope.update({"name": "read",
"email": "read",
"pennid": "read",
"is_staff": "read",
"is_active": "read"})
oidc_claim_scope.update(
{
"name": "read",
"email": "read",
"pennid": "read",
"is_staff": "read",
"is_active": "read",
}
)

def get_additional_claims(self, request):
return {
"name": request.user.preferred_name or
request.user.get_full_name(),
"name": request.user.preferred_name or request.user.get_full_name(),
"email": request.user.email,
"pennid": request.user.pennid,
"is_staff": request.user.is_staff,
Expand Down
11 changes: 6 additions & 5 deletions backend/accounts/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@
path("privacy/", PrivacySettingView.as_view(), name="privacy"),
path("privacy/<int:pk>/", PrivacySettingView.as_view(), name="privacy"),
path("user/<str:username>", FindUserView.as_view(), name="user"),
path(".well-known/openid-configuration",
ConnectDiscoveryInfoView.as_view(),
name="oidc-connect-discovery-info"),
path(".well-known/jwks.json", JwksInfoView.as_view(),
name="oidc-jwks-info"),
path(
".well-known/openid-configuration",
ConnectDiscoveryInfoView.as_view(),
name="oidc-connect-discovery-info",
),
path(".well-known/jwks.json", JwksInfoView.as_view(), name="oidc-jwks-info"),
]

urlpatterns += router.urls
Expand Down
3 changes: 1 addition & 2 deletions backend/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ def post(self, request):
"affiliation": affiliations,
}
user = auth.authenticate(
remote_user=user.pennid,
shibboleth_attributes=shibboleth_attributes
remote_user=user.pennid, shibboleth_attributes=shibboleth_attributes
)
auth.login(request, user)
return redirect(request.GET.get("next", "/accounts/me/"))
Expand Down

0 comments on commit 39331a8

Please sign in to comment.