move specific register statements to make them clearer to understant

This commit is contained in:
Matthias 2022-05-30 20:25:27 +02:00
parent 71937a180c
commit ca96654622
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -7,6 +7,7 @@ from import_export.admin import ImportExportModelAdmin
import common.models import common.models
@admin.site.register(common.models.InvenTreeSetting)
class SettingsAdmin(ImportExportModelAdmin): class SettingsAdmin(ImportExportModelAdmin):
"""Admin settings for InvenTreeSetting.""" """Admin settings for InvenTreeSetting."""
@ -20,6 +21,7 @@ class SettingsAdmin(ImportExportModelAdmin):
return [] return []
@admin.site.register(common.models.InvenTreeUserSetting)
class UserSettingsAdmin(ImportExportModelAdmin): class UserSettingsAdmin(ImportExportModelAdmin):
"""Admin settings for InvenTreeUserSetting.""" """Admin settings for InvenTreeUserSetting."""
@ -33,18 +35,21 @@ class UserSettingsAdmin(ImportExportModelAdmin):
return [] return []
@admin.site.register(common.models.WebhookEndpoint)
class WebhookAdmin(ImportExportModelAdmin): class WebhookAdmin(ImportExportModelAdmin):
"""Admin settings for Webhook.""" """Admin settings for Webhook."""
list_display = ('endpoint_id', 'name', 'active', 'user') list_display = ('endpoint_id', 'name', 'active', 'user')
@admin.site.register(common.models.NotificationEntry)
class NotificationEntryAdmin(admin.ModelAdmin): class NotificationEntryAdmin(admin.ModelAdmin):
"""Admin settings for NotificationEntry.""" """Admin settings for NotificationEntry."""
list_display = ('key', 'uid', 'updated', ) list_display = ('key', 'uid', 'updated', )
@admin.site.register(common.models.NotificationMessage)
class NotificationMessageAdmin(admin.ModelAdmin): class NotificationMessageAdmin(admin.ModelAdmin):
"""Admin settings for NotificationMessage.""" """Admin settings for NotificationMessage."""
@ -55,9 +60,5 @@ class NotificationMessageAdmin(admin.ModelAdmin):
search_fields = ('name', 'category', 'message', ) search_fields = ('name', 'category', 'message', )
admin.site.register(common.models.InvenTreeSetting, SettingsAdmin) # Register Models to admin
admin.site.register(common.models.InvenTreeUserSetting, UserSettingsAdmin)
admin.site.register(common.models.WebhookEndpoint, WebhookAdmin)
admin.site.register(common.models.WebhookMessage, ImportExportModelAdmin) admin.site.register(common.models.WebhookMessage, ImportExportModelAdmin)
admin.site.register(common.models.NotificationEntry, NotificationEntryAdmin)
admin.site.register(common.models.NotificationMessage, NotificationMessageAdmin)