From 11c3ac8bf83fba222f0ea6f92337b59dbe81cbab Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 13 Nov 2021 23:40:14 +0100 Subject: [PATCH] make id fields in plugins read_only Fixes #2305 --- InvenTree/plugin/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/admin.py b/InvenTree/plugin/admin.py index 69ac29a679..f877cbebf7 100644 --- a/InvenTree/plugin/admin.py +++ b/InvenTree/plugin/admin.py @@ -6,4 +6,9 @@ from django.contrib import admin import plugin.models as models -admin.site.register(models.PluginConfig, admin.ModelAdmin) +class PluginConfigAdmin(admin.ModelAdmin): + """Custom admin with restricted id fields""" + readonly_fields = ["key", "name", ] + + +admin.site.register(models.PluginConfig, PluginConfigAdmin)