0001-auth-oidc-add-slug-to-provider-model-26813.patch
src/authentic2_auth_oidc/admin.py | ||
---|---|---|
10 | 10 | |
11 | 11 | |
12 | 12 |
class OIDCProviderAdmin(admin.ModelAdmin): |
13 |
list_display = ['name', 'client_id', 'ou', 'created', 'modified'] |
|
13 |
list_display = ['name', 'slug', 'client_id', 'ou', 'created', 'modified']
|
|
14 | 14 |
inlines = [OIDCClaimMappingInline] |
15 | 15 |
list_filter = ['ou'] |
16 | 16 |
date_hierarchy = 'modified' |
17 | 17 |
readonly_fields = ['created', 'modified'] |
18 |
prepopulated_fields = {'slug': ('name',)} |
|
18 | 19 | |
19 | 20 | |
20 | 21 |
class OIDCAccountAdmin(admin.ModelAdmin): |
src/authentic2_auth_oidc/migrations/0005_oidcprovider_slug.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# Generated by Django 1.11.12 on 2018-09-28 08:58 |
|
3 |
from __future__ import unicode_literals |
|
4 | ||
5 |
from django.db import migrations, models |
|
6 | ||
7 | ||
8 |
class Migration(migrations.Migration): |
|
9 | ||
10 |
dependencies = [ |
|
11 |
('authentic2_auth_oidc', '0004_auto_20171017_1522'), |
|
12 |
] |
|
13 | ||
14 |
operations = [ |
|
15 |
migrations.AddField( |
|
16 |
model_name='oidcprovider', |
|
17 |
name='slug', |
|
18 |
field=models.SlugField(blank=True, max_length=256, null=True, unique=True, verbose_name='slug'), |
|
19 |
), |
|
20 |
] |
src/authentic2_auth_oidc/models.py | ||
---|---|---|
46 | 46 |
unique=True, |
47 | 47 |
max_length=128, |
48 | 48 |
verbose_name=_('name')) |
49 |
slug = models.SlugField( |
|
50 |
unique=True, |
|
51 |
max_length=256, |
|
52 |
verbose_name=_('slug'), |
|
53 |
blank=True, |
|
54 |
null=True) |
|
49 | 55 |
issuer = models.CharField( |
50 | 56 |
max_length=256, |
51 | 57 |
verbose_name=_('issuer'), |
src/authentic2_auth_oidc/templates/authentic2_auth_oidc/login.html | ||
---|---|---|
1 | 1 |
{% for provider in providers %} |
2 |
<p id="oidc-p-{{ provider.name|slugify }}">
|
|
3 |
<a id="oidc-a-{{ provider.name|slugify }}"
|
|
2 |
<p id="oidc-p-{% firstof provider.slug provider.name|slugify %}">
|
|
3 |
<a id="oidc-a-{% firstof provider.slug provider.name|slugify %}"
|
|
4 | 4 |
href="{% url "oidc-login" pk=provider.pk %}?{{ request.GET.urlencode }}">{{ provider.name }}</a> |
5 | 5 |
</p> |
6 | 6 |
{% endfor %} |
7 |
- |