From 6eab8ab72f7de59ffc1b665de536aedbca427ed0 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 13 Mar 2014 11:03:21 +0100 Subject: [PATCH] add plugin hook to setup admin blocks --- authentic2_idp_oauth2/__init__.py | 4 ++++ authentic2_idp_oauth2/admin.py | 4 +++- authentic2_idp_oauth2/models.py | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/authentic2_idp_oauth2/__init__.py b/authentic2_idp_oauth2/__init__.py index d961ede..bb8022f 100644 --- a/authentic2_idp_oauth2/__init__.py +++ b/authentic2_idp_oauth2/__init__.py @@ -10,6 +10,10 @@ class Plugin(object): def get_apps(self): return ['rest_framework', 'provider', 'provider.oauth2', __name__] + def get_admin_modules(self): + from . import dashboard + return dashboard.get_admin_modules() + def logout_list(self, request): from . import models diff --git a/authentic2_idp_oauth2/admin.py b/authentic2_idp_oauth2/admin.py index a192789..94afa64 100644 --- a/authentic2_idp_oauth2/admin.py +++ b/authentic2_idp_oauth2/admin.py @@ -1,5 +1,7 @@ from django.contrib import admin +from provider.oauth2.admin import ClientAdmin + from . import models -admin.site.register(models.A2Client) +admin.site.register(models.A2Client, ClientAdmin) diff --git a/authentic2_idp_oauth2/models.py b/authentic2_idp_oauth2/models.py index 32e4c67..5952955 100644 --- a/authentic2_idp_oauth2/models.py +++ b/authentic2_idp_oauth2/models.py @@ -1,6 +1,10 @@ +from django.utils.translation import ugettext_lazy as _ + from provider.oauth2.models import Client from authentic2.models import LogoutUrlAbstract class A2Client(LogoutUrlAbstract, Client): - pass + class Meta: + verbose_name = _('client') + verbose_name_plural = _('clients')