admin: fix linting

This commit is contained in:
Jens Langhammer 2020-05-20 13:59:56 +02:00
parent c329a724e8
commit cafe2f1e1f
9 changed files with 58 additions and 36 deletions

View File

@ -29,9 +29,7 @@ class PolicyListView(LoginRequiredMixin, PermissionListMixin, ListView):
template_name = "administration/policy/list.html"
def get_context_data(self, **kwargs):
kwargs["types"] = {
x.__name__: x for x in all_subclasses(Policy)
}
kwargs["types"] = {x.__name__: x for x in all_subclasses(Policy)}
return super().get_context_data(**kwargs)
def get_queryset(self):

View File

@ -26,9 +26,7 @@ class PropertyMappingListView(LoginRequiredMixin, PermissionListMixin, ListView)
paginate_by = 40
def get_context_data(self, **kwargs):
kwargs["types"] = {
x.__name__: x for x in all_subclasses(PropertyMapping)
}
kwargs["types"] = {x.__name__: x for x in all_subclasses(PropertyMapping)}
return super().get_context_data(**kwargs)
def get_queryset(self):

View File

@ -26,9 +26,7 @@ class ProviderListView(LoginRequiredMixin, PermissionListMixin, ListView):
ordering = "id"
def get_context_data(self, **kwargs):
kwargs["types"] = {
x.__name__: x for x in all_subclasses(Provider)
}
kwargs["types"] = {x.__name__: x for x in all_subclasses(Provider)}
return super().get_context_data(**kwargs)
def get_queryset(self):

View File

@ -26,9 +26,7 @@ class SourceListView(LoginRequiredMixin, PermissionListMixin, ListView):
template_name = "administration/source/list.html"
def get_context_data(self, **kwargs):
kwargs["types"] = {
x.__name__: x for x in all_subclasses(Source)
}
kwargs["types"] = {x.__name__: x for x in all_subclasses(Source)}
return super().get_context_data(**kwargs)
def get_queryset(self):

View File

@ -26,9 +26,7 @@ class StageListView(LoginRequiredMixin, PermissionListMixin, ListView):
paginate_by = 40
def get_context_data(self, **kwargs):
kwargs["types"] = {
x.__name__: x for x in all_subclasses(Stage)
}
kwargs["types"] = {x.__name__: x for x in all_subclasses(Stage)}
return super().get_context_data(**kwargs)
def get_queryset(self):

View File

@ -101,6 +101,7 @@ def debug(obj) -> str:
LOGGER.debug(obj)
return ""
@register.filter
def doc(obj) -> str:
"""Return docstring of object"""

View File

@ -6,28 +6,45 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passbook_sources_oauth', '0001_initial'),
("passbook_sources_oauth", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name='oauthsource',
name='access_token_url',
field=models.CharField(help_text='URL used by passbook to retrive tokens.', max_length=255, verbose_name='Access Token URL'),
model_name="oauthsource",
name="access_token_url",
field=models.CharField(
help_text="URL used by passbook to retrive tokens.",
max_length=255,
verbose_name="Access Token URL",
),
),
migrations.AlterField(
model_name='oauthsource',
name='request_token_url',
field=models.CharField(blank=True, help_text='URL used to request the initial token. This URL is only required for OAuth 1.', max_length=255, verbose_name='Request Token URL'),
model_name="oauthsource",
name="request_token_url",
field=models.CharField(
blank=True,
help_text="URL used to request the initial token. This URL is only required for OAuth 1.",
max_length=255,
verbose_name="Request Token URL",
),
),
migrations.AlterField(
model_name='oauthsource',
name='authorization_url',
field=models.CharField(help_text='URL the user is redirect to to conest the flow.', max_length=255, verbose_name='Authorization URL'),
model_name="oauthsource",
name="authorization_url",
field=models.CharField(
help_text="URL the user is redirect to to conest the flow.",
max_length=255,
verbose_name="Authorization URL",
),
),
migrations.AlterField(
model_name='oauthsource',
name='profile_url',
field=models.CharField(help_text='URL used by passbook to get user information.', max_length=255, verbose_name='Profile URL'),
model_name="oauthsource",
name="profile_url",
field=models.CharField(
help_text="URL used by passbook to get user information.",
max_length=255,
verbose_name="Profile URL",
),
),
]

View File

@ -14,20 +14,28 @@ class OAuthSource(Source):
provider_type = models.CharField(max_length=255)
request_token_url = models.CharField(
blank=True, max_length=255, verbose_name=_("Request Token URL"),
help_text=_("URL used to request the initial token. This URL is only required for OAuth 1.")
blank=True,
max_length=255,
verbose_name=_("Request Token URL"),
help_text=_(
"URL used to request the initial token. This URL is only required for OAuth 1."
),
)
authorization_url = models.CharField(
max_length=255, verbose_name=_("Authorization URL"),
help_text=_("URL the user is redirect to to conest the flow.")
max_length=255,
verbose_name=_("Authorization URL"),
help_text=_("URL the user is redirect to to conest the flow."),
)
access_token_url = models.CharField(
max_length=255, verbose_name=_("Access Token URL"),
help_text=_("URL used by passbook to retrive tokens.")
max_length=255,
verbose_name=_("Access Token URL"),
help_text=_("URL used by passbook to retrive tokens."),
)
profile_url = models.CharField(
max_length=255, verbose_name=_("Profile URL"),
help_text=_("URL used by passbook to get user information."))
max_length=255,
verbose_name=_("Profile URL"),
help_text=_("URL used by passbook to get user information."),
)
consumer_key = models.TextField()
consumer_secret = models.TextField()
@ -145,6 +153,7 @@ class AzureADOAuthSource(OAuthSource):
verbose_name = _("Azure AD OAuth Source")
verbose_name_plural = _("Azure AD OAuth Sources")
class OpenIDOAuthSource(OAuthSource):
"""Abstract subclass of OAuthSource to specify OpenID Form"""

View File

@ -5780,20 +5780,25 @@ definitions:
minLength: 1
request_token_url:
title: Request Token URL
description: URL used to request the initial token. This URL is only required
for OAuth 1.
type: string
maxLength: 255
authorization_url:
title: Authorization URL
description: URL the user is redirect to to conest the flow.
type: string
maxLength: 255
minLength: 1
access_token_url:
title: Access Token URL
description: URL used by passbook to retrive tokens.
type: string
maxLength: 255
minLength: 1
profile_url:
title: Profile URL
description: URL used by passbook to get user information.
type: string
maxLength: 255
minLength: 1