Skip to content

Commit bb6b326

Browse files
committed
Black format everything.
1 parent 15c8705 commit bb6b326

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2415
-1715
lines changed

docs/conf.py

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
extensions = []
3232

3333
# Add any paths that contain templates here, relative to this directory.
34-
templates_path = ['_templates']
34+
templates_path = ["_templates"]
3535

3636
# The suffix(es) of source filenames.
3737
# You can specify multiple suffix as a list of string:
@@ -41,28 +41,28 @@
4141
# source_encoding = 'utf-8-sig'
4242

4343
# The master toctree document.
44-
master_doc = 'index'
44+
master_doc = "index"
4545

4646
# General information about the project.
47-
project = u'django-oidc-provider'
48-
copyright = u'2025, Juan Ignacio Fiorentino'
49-
author = u'Juan Ignacio Fiorentino'
47+
project = "django-oidc-provider"
48+
copyright = "2025, Juan Ignacio Fiorentino"
49+
author = "Juan Ignacio Fiorentino"
5050

5151
# The version info for the project you're documenting, acts as replacement for
5252
# |version| and |release|, also used in various other places throughout the
5353
# built documents.
5454
#
5555
# The short X.Y version.
56-
version = u'0.8'
56+
version = "0.8"
5757
# The full version, including alpha/beta/rc tags.
58-
release = u'0.8'
58+
release = "0.8"
5959

6060
# The language for content autogenerated by Sphinx. Refer to documentation
6161
# for a list of supported languages.
6262
#
6363
# This is also used if you do content translation via gettext catalogs.
6464
# Usually you set "language" from the command line for these cases.
65-
language = 'en'
65+
language = "en"
6666

6767
# There are two options for replacing |today|: either, you set today to some
6868
# non-false value, then it is used:
@@ -72,7 +72,7 @@
7272

7373
# List of patterns, relative to source directory, that match files and
7474
# directories to ignore when looking for source files.
75-
exclude_patterns = ['_build']
75+
exclude_patterns = ["_build"]
7676

7777
# The reST default role (used for this markup: `text`) to use for all
7878
# documents.
@@ -90,7 +90,7 @@
9090
# show_authors = False
9191

9292
# The name of the Pygments (syntax highlighting) style to use.
93-
pygments_style = 'sphinx'
93+
pygments_style = "sphinx"
9494

9595
# A list of ignored prefixes for module index sorting.
9696
# modindex_common_prefix = []
@@ -106,7 +106,7 @@
106106

107107
# The theme to use for HTML and HTML Help pages. See the documentation for
108108
# a list of builtin themes.
109-
html_theme = 'sphinx_rtd_theme'
109+
html_theme = "sphinx_rtd_theme"
110110

111111
# Theme options are theme-specific and customize the look and feel of a theme
112112
# further. For a list of options available for each theme, see the
@@ -135,7 +135,7 @@
135135
# Add any paths that contain custom static files (such as style sheets) here,
136136
# relative to this directory. They are copied after the builtin static files,
137137
# so a file named "default.css" will overwrite the builtin "default.css".
138-
html_static_path = ['_static']
138+
html_static_path = ["_static"]
139139

140140
# Add any extra paths that contain custom files (such as robots.txt or
141141
# .htaccess) here, relative to this directory. These files are copied
@@ -198,20 +198,17 @@
198198
# html_search_scorer = 'scorer.js'
199199

200200
# Output file base name for HTML help builder.
201-
htmlhelp_basename = 'django-oidc-providerdoc'
201+
htmlhelp_basename = "django-oidc-providerdoc"
202202

203203
# -- Options for LaTeX output ---------------------------------------------
204204

205205
latex_elements = {
206206
# The paper size ('letterpaper' or 'a4paper').
207207
# 'papersize': 'letterpaper',
208-
209208
# The font size ('10pt', '11pt' or '12pt').
210209
# 'pointsize': '10pt',
211-
212210
# Additional stuff for the LaTeX preamble.
213211
# 'preamble': '',
214-
215212
# Latex figure (float) alignment
216213
# 'figure_align': 'htbp',
217214
}
@@ -220,8 +217,13 @@
220217
# (source start file, target name, title,
221218
# author, documentclass [howto, manual, or own class]).
222219
latex_documents = [
223-
(master_doc, 'django-oidc-provider.tex', u'django-oidc-provider Documentation',
224-
u'Juan Ignacio Fiorentino', 'manual'),
220+
(
221+
master_doc,
222+
"django-oidc-provider.tex",
223+
"django-oidc-provider Documentation",
224+
"Juan Ignacio Fiorentino",
225+
"manual",
226+
),
225227
]
226228

227229
# The name of an image file (relative to this directory) to place at the top of
@@ -250,8 +252,13 @@
250252
# One entry per manual page. List of tuples
251253
# (source start file, name, description, authors, manual section).
252254
man_pages = [
253-
(master_doc, 'django-oidc-provider', u'django-oidc-provider Documentation',
254-
[author], 1)
255+
(
256+
master_doc,
257+
"django-oidc-provider",
258+
"django-oidc-provider Documentation",
259+
[author],
260+
1,
261+
)
255262
]
256263

257264
# If true, show URL addresses after external links.
@@ -264,9 +271,15 @@
264271
# (source start file, target name, title, author,
265272
# dir menu entry, description, category)
266273
texinfo_documents = [
267-
(master_doc, 'django-oidc-provider', u'django-oidc-provider Documentation',
268-
author, 'django-oidc-provider', 'One line description of project.',
269-
'Miscellaneous'),
274+
(
275+
master_doc,
276+
"django-oidc-provider",
277+
"django-oidc-provider Documentation",
278+
author,
279+
"django-oidc-provider",
280+
"One line description of project.",
281+
"Miscellaneous",
282+
),
270283
]
271284

272285
# Documents to append as an appendix to all manuals.
@@ -328,7 +341,7 @@
328341
# epub_post_files = []
329342

330343
# A list of files that should not be packed into the epub file.
331-
epub_exclude_files = ['search.html']
344+
epub_exclude_files = ["search.html"]
332345

333346
# The depth of the table of contents in toc.ncx.
334347
# epub_tocdepth = 3

example/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
55

6-
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
6+
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
77

88
SECRET_KEY = "c14d549c574e4d8cf162404ef0b04598"
99

example/app/urls.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@
55

66

77
urlpatterns = [
8-
re_path(r"^$", TemplateView.as_view(template_name='home.html'), name='home'),
9-
re_path(r"^accounts/login/$", auth_views.LoginView.as_view(template_name='login.html'), name='login'), # noqa
10-
re_path(r"^accounts/logout/$", auth_views.LogoutView.as_view(next_page='/'), name='logout'),
11-
re_path(r"^", include('oidc_provider.urls', namespace='oidc_provider')),
8+
re_path(r"^$", TemplateView.as_view(template_name="home.html"), name="home"),
9+
re_path(
10+
r"^accounts/login/$",
11+
auth_views.LoginView.as_view(template_name="login.html"),
12+
name="login",
13+
), # noqa
14+
re_path(
15+
r"^accounts/logout/$",
16+
auth_views.LogoutView.as_view(next_page="/"),
17+
name="logout",
18+
),
19+
re_path(r"^", include("oidc_provider.urls", namespace="oidc_provider")),
1220
re_path(r"^admin/", admin.site.urls),
1321
]

example/app/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
from django.core.wsgi import get_wsgi_application
44

55

6-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
77

88
application = get_wsgi_application()

example/manage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import os
33
import sys
44

5-
if __name__ == '__main__':
6-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
77

88
from django.core.management import execute_from_command_line
99

oidc_provider/admin.py

Lines changed: 60 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,34 @@ class Meta:
1717

1818
def __init__(self, *args, **kwargs):
1919
super(ClientForm, self).__init__(*args, **kwargs)
20-
self.fields['client_id'].required = False
21-
self.fields['client_id'].widget.attrs['disabled'] = 'true'
22-
self.fields['client_secret'].required = False
23-
self.fields['client_secret'].widget.attrs['disabled'] = 'true'
20+
self.fields["client_id"].required = False
21+
self.fields["client_id"].widget.attrs["disabled"] = "true"
22+
self.fields["client_secret"].required = False
23+
self.fields["client_secret"].widget.attrs["disabled"] = "true"
2424

2525
def clean_client_id(self):
26-
instance = getattr(self, 'instance', None)
26+
instance = getattr(self, "instance", None)
2727
if instance and instance.pk:
2828
return instance.client_id
2929
else:
3030
return str(randint(1, 999999)).zfill(6)
3131

3232
def clean_client_secret(self):
33-
instance = getattr(self, 'instance', None)
33+
instance = getattr(self, "instance", None)
3434

35-
secret = ''
35+
secret = ""
3636

3737
if instance and instance.pk:
38-
if (self.cleaned_data['client_type'] == 'confidential') and not instance.client_secret:
38+
if (
39+
self.cleaned_data["client_type"] == "confidential"
40+
) and not instance.client_secret:
3941
secret = sha224(uuid4().hex.encode()).hexdigest()
40-
elif (self.cleaned_data['client_type'] == 'confidential') and instance.client_secret:
42+
elif (
43+
self.cleaned_data["client_type"] == "confidential"
44+
) and instance.client_secret:
4145
secret = instance.client_secret
4246
else:
43-
if (self.cleaned_data['client_type'] == 'confidential'):
47+
if self.cleaned_data["client_type"] == "confidential":
4448
secret = sha224(uuid4().hex.encode()).hexdigest()
4549

4650
return secret
@@ -50,32 +54,57 @@ def clean_client_secret(self):
5054
class ClientAdmin(admin.ModelAdmin):
5155

5256
fieldsets = [
53-
[_(u''), {
54-
'fields': (
55-
'name', 'owner', 'client_type', 'response_types', '_redirect_uris', 'jwt_alg',
56-
'require_consent', 'reuse_consent'),
57-
}],
58-
[_(u'Credentials'), {
59-
'fields': ('client_id', 'client_secret', '_scope'),
60-
}],
61-
[_(u'Information'), {
62-
'fields': ('contact_email', 'website_url', 'terms_url', 'logo', 'date_created'),
63-
}],
64-
[_(u'Session Management'), {
65-
'fields': ('_post_logout_redirect_uris',),
66-
}],
57+
[
58+
_(""),
59+
{
60+
"fields": (
61+
"name",
62+
"owner",
63+
"client_type",
64+
"response_types",
65+
"_redirect_uris",
66+
"jwt_alg",
67+
"require_consent",
68+
"reuse_consent",
69+
),
70+
},
71+
],
72+
[
73+
_("Credentials"),
74+
{
75+
"fields": ("client_id", "client_secret", "_scope"),
76+
},
77+
],
78+
[
79+
_("Information"),
80+
{
81+
"fields": (
82+
"contact_email",
83+
"website_url",
84+
"terms_url",
85+
"logo",
86+
"date_created",
87+
),
88+
},
89+
],
90+
[
91+
_("Session Management"),
92+
{
93+
"fields": ("_post_logout_redirect_uris",),
94+
},
95+
],
6796
]
6897
form = ClientForm
69-
list_display = ['name', 'client_id', 'response_type_descriptions', 'date_created']
70-
readonly_fields = ['date_created']
71-
search_fields = ['name']
72-
raw_id_fields = ['owner']
98+
list_display = ["name", "client_id", "response_type_descriptions", "date_created"]
99+
readonly_fields = ["date_created"]
100+
search_fields = ["name"]
101+
raw_id_fields = ["owner"]
73102

74103

75104
@admin.register(Code)
76105
class CodeAdmin(admin.ModelAdmin):
77106

78-
raw_id_fields = ['user']
107+
raw_id_fields = ["user"]
79108

80109
def has_add_permission(self, request):
81110
return False
@@ -84,7 +113,7 @@ def has_add_permission(self, request):
84113
@admin.register(Token)
85114
class TokenAdmin(admin.ModelAdmin):
86115

87-
raw_id_fields = ['user']
116+
raw_id_fields = ["user"]
88117

89118
def has_add_permission(self, request):
90119
return False
@@ -93,4 +122,4 @@ def has_add_permission(self, request):
93122
@admin.register(RSAKey)
94123
class RSAKeyAdmin(admin.ModelAdmin):
95124

96-
readonly_fields = ['kid']
125+
readonly_fields = ["kid"]

oidc_provider/apps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
class OIDCProviderConfig(AppConfig):
55

6-
name = 'oidc_provider'
7-
verbose_name = u'OpenID Connect Provider'
6+
name = "oidc_provider"
7+
verbose_name = "OpenID Connect Provider"

0 commit comments

Comments
 (0)