mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
admin: allow editing ClassicRecipe fields
There's no particular reason these fields should be read-only (unlike the fields picked up from Recipe, they aren't derived from the recipe itself.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
1cb5945f03
commit
644baaf596
|
@ -122,9 +122,10 @@ class ClassicRecipeAdmin(admin.ModelAdmin):
|
||||||
search_fields = ['filename', 'pn', 'cover_pn']
|
search_fields = ['filename', 'pn', 'cover_pn']
|
||||||
list_filter = ['layerbranch__layer__name', 'layerbranch__branch__name']
|
list_filter = ['layerbranch__layer__name', 'layerbranch__branch__name']
|
||||||
def get_readonly_fields(self, request, obj=None):
|
def get_readonly_fields(self, request, obj=None):
|
||||||
|
rwfields = ['cover_layerbranch', 'cover_pn', 'cover_status', 'cover_verified', 'cover_comment', 'classic_category', 'needs_attention', 'sha256sum', 'export']
|
||||||
rofields = []
|
rofields = []
|
||||||
for f in ClassicRecipe._meta.get_fields():
|
for f in ClassicRecipe._meta.get_fields():
|
||||||
if not (f.auto_created and f.is_relation):
|
if f.name not in rwfields and not (f.auto_created and f.is_relation):
|
||||||
rofields.append(f.name)
|
rofields.append(f.name)
|
||||||
return rofields
|
return rofields
|
||||||
def has_add_permission(self, request, obj=None):
|
def has_add_permission(self, request, obj=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user