admin,dashboard: show see technical models admin pages even if DEBUG is False
Hiding of technical models should be done through permissions.
This commit is contained in:
parent
361c135ea3
commit
83052926b8
|
@ -11,39 +11,38 @@ from django.contrib.sessions.models import Session
|
|||
from .nonce.models import Nonce
|
||||
from . import forms, models, admin_forms, compat, app_settings
|
||||
|
||||
if settings.DEBUG:
|
||||
class NonceModelAdmin(admin.ModelAdmin):
|
||||
list_display = ("value", "context", "not_on_or_after")
|
||||
admin.site.register(Nonce, NonceModelAdmin)
|
||||
class AttributeValueAdmin(admin.ModelAdmin):
|
||||
list_display = ('content_type', 'owner', 'attribute',
|
||||
'content')
|
||||
admin.site.register(models.AttributeValue, AttributeValueAdmin)
|
||||
class FederatedIdAdmin(admin.ModelAdmin):
|
||||
list_display = ('provider', 'about', 'service', 'id_format', 'id_value')
|
||||
list_filter = ('provider', 'about', 'service', 'id_format')
|
||||
class NonceModelAdmin(admin.ModelAdmin):
|
||||
list_display = ("value", "context", "not_on_or_after")
|
||||
admin.site.register(Nonce, NonceModelAdmin)
|
||||
class AttributeValueAdmin(admin.ModelAdmin):
|
||||
list_display = ('content_type', 'owner', 'attribute',
|
||||
'content')
|
||||
admin.site.register(models.AttributeValue, AttributeValueAdmin)
|
||||
class FederatedIdAdmin(admin.ModelAdmin):
|
||||
list_display = ('provider', 'about', 'service', 'id_format', 'id_value')
|
||||
list_filter = ('provider', 'about', 'service', 'id_format')
|
||||
|
||||
admin.site.register(models.FederatedId, FederatedIdAdmin)
|
||||
class LogoutUrlAdmin(admin.ModelAdmin):
|
||||
list_display = ('provider', 'logout_url', 'logout_use_iframe', 'logout_use_iframe_timeout')
|
||||
admin.site.register(models.LogoutUrl, LogoutUrlAdmin)
|
||||
class AuthenticationEventAdmin(admin.ModelAdmin):
|
||||
list_display = ('when', 'who', 'how', 'nonce')
|
||||
list_filter = ('how',)
|
||||
date_hierarchy = 'when'
|
||||
search_fields = ('who', 'nonce', 'how')
|
||||
admin.site.register(models.FederatedId, FederatedIdAdmin)
|
||||
class LogoutUrlAdmin(admin.ModelAdmin):
|
||||
list_display = ('provider', 'logout_url', 'logout_use_iframe', 'logout_use_iframe_timeout')
|
||||
admin.site.register(models.LogoutUrl, LogoutUrlAdmin)
|
||||
class AuthenticationEventAdmin(admin.ModelAdmin):
|
||||
list_display = ('when', 'who', 'how', 'nonce')
|
||||
list_filter = ('how',)
|
||||
date_hierarchy = 'when'
|
||||
search_fields = ('who', 'nonce', 'how')
|
||||
|
||||
admin.site.register(models.AuthenticationEvent, AuthenticationEventAdmin)
|
||||
class UserExternalIdAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'source', 'external_id', 'created', 'updated')
|
||||
list_filter = ('source',)
|
||||
date_hierarchy = 'created'
|
||||
search_fields = ('user__username', 'source', 'external_id')
|
||||
admin.site.register(models.UserExternalId, UserExternalIdAdmin)
|
||||
class DeletedUserAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'creation')
|
||||
date_hierarchy = 'creation'
|
||||
admin.site.register(models.DeletedUser, DeletedUserAdmin)
|
||||
admin.site.register(models.AuthenticationEvent, AuthenticationEventAdmin)
|
||||
class UserExternalIdAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'source', 'external_id', 'created', 'updated')
|
||||
list_filter = ('source',)
|
||||
date_hierarchy = 'created'
|
||||
search_fields = ('user__username', 'source', 'external_id')
|
||||
admin.site.register(models.UserExternalId, UserExternalIdAdmin)
|
||||
class DeletedUserAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'creation')
|
||||
date_hierarchy = 'creation'
|
||||
admin.site.register(models.DeletedUser, DeletedUserAdmin)
|
||||
|
||||
DB_SESSION_ENGINES = (
|
||||
'django.contrib.sessions.backends.db',
|
||||
|
|
|
@ -61,20 +61,19 @@ class CustomIndexDashboard(Dashboard):
|
|||
'authentic2.attribute_aggregator.models.AttributeSource',
|
||||
),
|
||||
))
|
||||
if settings.DEBUG:
|
||||
self.children.append(modules.ModelList(
|
||||
_('Debug'),
|
||||
models=(
|
||||
'authentic2.models.AttributeValue',
|
||||
'authentic2.nonce.models.Nonce',
|
||||
'authentic2.models.FederatedId',
|
||||
'authentic2.models.LogoutUrl',
|
||||
'authentic2.models.AuthenticationEvent',
|
||||
'authentic2.models.UserExternalId',
|
||||
'authentic2.models.DeletedUser',
|
||||
'django.contrib.sessions.*',
|
||||
),
|
||||
))
|
||||
self.children.append(modules.ModelList(
|
||||
_('Debug'),
|
||||
models=(
|
||||
'authentic2.models.AttributeValue',
|
||||
'authentic2.nonce.models.Nonce',
|
||||
'authentic2.models.FederatedId',
|
||||
'authentic2.models.LogoutUrl',
|
||||
'authentic2.models.AuthenticationEvent',
|
||||
'authentic2.models.UserExternalId',
|
||||
'authentic2.models.DeletedUser',
|
||||
'django.contrib.sessions.*',
|
||||
),
|
||||
))
|
||||
for plugin in plugins.get_plugins():
|
||||
if hasattr(plugin, 'get_admin_modules') and callable(plugin.get_admin_modules):
|
||||
plugin_modules = plugin.get_admin_modules()
|
||||
|
|
Loading…
Reference in New Issue