diff options
author | Amanda Brindle <amanda.r.brindle@intel.com> | 2017-09-25 16:41:32 -0700 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-09-27 15:26:24 +1300 |
commit | fdcde0071080a59e1fad17a9479f3d8ca065e8cb (patch) | |
tree | 63297f6d46d2acaac06a68780c37127b4ab356af /layerindex/admin.py | |
parent | e3975247913dfa5ac5ed8056b96e3b514e26c473 (diff) | |
download | openembedded-core-contrib-fdcde0071080a59e1fad17a9479f3d8ca065e8cb.tar.gz |
Indicate if layer has YP Compatible certification
Allow admin to create Yocto Project versions with the version name,
description, an icon link that represents that version, and a link that
contains more information about the version.
Admins who have the "set_yp_compatibility" permission can then
decide if a layer has Yocto Project compatible certification,
and if it does, admin can choose which version of Yocto Project
the layer is compatible with. If a layer is deemed compatible,
the version's icon will appear next to the layer's name, and
the icon be a clickable link to a page with more information.
Fixes [YOCTO #11452]
Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/admin.py')
-rw-r--r-- | layerindex/admin.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/layerindex/admin.py b/layerindex/admin.py index d25829aded..a7d024b11e 100644 --- a/layerindex/admin.py +++ b/layerindex/admin.py @@ -44,6 +44,9 @@ class BranchAdmin(CompareVersionAdmin): layerdependency.save() duplicate.short_description = "Duplicate selected Branches" +class YPCompatibleVersionAdmin(CompareVersionAdmin): + pass + class LayerItemAdmin(CompareVersionAdmin): list_filter = ['status', 'layer_type'] save_as = True @@ -61,9 +64,12 @@ class LayerBranchAdmin(CompareVersionAdmin): LayerMaintainerInline, ] def get_readonly_fields(self, request, obj=None): + readonly_fields = self.readonly_fields if obj: - return self.readonly_fields + ('layer', 'branch') - return self.readonly_fields + readonly_fields += ('layer', 'branch') + if not request.user.has_perm('layerindex.set_yp_compatibility'): + readonly_fields += ('yp_compatible_version',) + return readonly_fields class LayerMaintainerAdmin(CompareVersionAdmin): list_filter = ['status', 'layerbranch__layer__name'] @@ -145,6 +151,7 @@ class RecipeChangesetAdmin(admin.ModelAdmin): ] admin.site.register(Branch, BranchAdmin) +admin.site.register(YPCompatibleVersion, YPCompatibleVersionAdmin) admin.site.register(LayerItem, LayerItemAdmin) admin.site.register(LayerBranch, LayerBranchAdmin) admin.site.register(LayerMaintainer, LayerMaintainerAdmin) |