Skip to content

Commit 44b6e6d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b2840cc commit 44b6e6d

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

src/profiles/forms.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
def get_scopes() -> list[str]:
66
validator = BornhackOAuth2Validator()
7-
return ((scope, scope) for scope in sorted(set(validator.oidc_claim_scope.values())) if scope!="openid")
7+
return (
8+
(scope, scope)
9+
for scope in sorted(set(validator.oidc_claim_scope.values()))
10+
if scope != "openid"
11+
)
12+
813

9-
1014
class OIDCForm(forms.Form):
1115
scopes = forms.MultipleChoiceField(
1216
choices=get_scopes,
1317
help_text="Select the scopes to simulate. The 'openid' scope is always included.",
14-
)
18+
)

src/profiles/templates/oidc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<h4>OIDC Claims</h4>
1212
</div>
1313
<div class="card-body">
14-
<p class="lead">When using BornHack as an IDP (logging into other sites using your BornHack account) you can control which <i>user claims</i> are shared with the remote site by asking for one or more of the following <i>claim scopes</i>:</p>
14+
<p class="lead">When using BornHack as an IDP (logging into other sites using your BornHack account) you can control which <i>user claims</i> are shared with the remote site by asking for one or more of the following <i>claim scopes</i>:</p>
1515
<p><ul>
1616
{% for scope in all_scopes %}
1717
<li><code>{{ scope }}</code></li>

src/profiles/views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ def get_context_data(self, **kwargs):
155155
if scope in self.request.GET.getlist(key="scopes"):
156156
context["claims"][claim] = value
157157
context["scopes"] = self.scopes
158-
context["active_scopes"] = ["openid"] + sorted(set(self.request.GET.getlist(key="scopes")))
158+
context["active_scopes"] = ["openid"] + sorted(
159+
set(self.request.GET.getlist(key="scopes"))
160+
)
159161
context["all_scopes"] = sorted(set(self.scopes.values()))
160-
del(context["all_scopes"][context["all_scopes"].index("openid")])
161-
return context
162+
del context["all_scopes"][context["all_scopes"].index("openid")]
163+
return context

0 commit comments

Comments
 (0)